Set alters_data=True on model methods as appropriate #6323

Closed
opened 2025-12-29 19:39:24 +01:00 by adam · 0 comments
Owner

Originally created by @jeremystretch on GitHub (Apr 7, 2022).

Originally assigned to: @arthanson on GitHub.

Proposed Changes

Audit the code base and set alters_data=True on all model methods which alter object data.

Justification

The Django documentation recommends this to avoid accidentally calling potentially destructive methods when rendering templates.

Originally created by @jeremystretch on GitHub (Apr 7, 2022). Originally assigned to: @arthanson on GitHub. ### Proposed Changes Audit the code base and set `alters_data=True` on all model methods which alter object data. ### Justification The [Django documentation](https://docs.djangoproject.com/en/4.0/ref/templates/api/#variables-and-lookups) recommends this to avoid accidentally calling potentially destructive methods when rendering templates.
adam added the status: acceptedtype: housekeeping labels 2025-12-29 19:39:24 +01:00
adam closed this issue 2025-12-29 19:39:24 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#6323