Check codebase for model-clean modifying fields #7841

Closed
opened 2025-12-29 20:28:53 +01:00 by adam · 0 comments
Owner

Originally created by @arthanson on GitHub (Mar 31, 2023).

Originally assigned to: @jeremystretch on GitHub.

Proposed Changes

as per issue #12074 there are probably other areas on the codebase where we are modifying fields in the model-clean methods, all modifications should be done in model-save and clean just does verification.

Justification

Modifying fields in model-clean while not advised against is problematic and does lead to problems with the REST APIs, it is also just cleaner to do the modifications in the model-save and only do validation in clean.

Originally created by @arthanson on GitHub (Mar 31, 2023). Originally assigned to: @jeremystretch on GitHub. ### Proposed Changes as per issue #12074 there are probably other areas on the codebase where we are modifying fields in the model-clean methods, all modifications should be done in model-save and clean just does verification. ### Justification Modifying fields in model-clean while not advised against is problematic and does lead to problems with the REST APIs, it is also just cleaner to do the modifications in the model-save and only do validation in clean.
adam added the status: acceptedtype: housekeeping labels 2025-12-29 20:28:53 +01:00
adam closed this issue 2025-12-29 20:28:53 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#7841