Object replication forms should not inherit from ModelForm #7621

Open
opened 2025-12-29 20:26:08 +01:00 by adam · 0 comments
Owner

Originally created by @jeremystretch on GitHub (Feb 8, 2023).

Proposed Changes

Convert all forms which facilitate the automatic replication of new objects from a pattern (e.g. InterfaceCreateForm) to regular forms which do not inherit from ModelForm.

Justification

Inheriting from ModelForm results in calling clean() on the resulting instance, which may not be desirable. See #11032 for an example where this is problematic.

Originally created by @jeremystretch on GitHub (Feb 8, 2023). ### Proposed Changes Convert all forms which facilitate the automatic replication of new objects from a pattern (e.g. InterfaceCreateForm) to regular forms which do not inherit from ModelForm. ### Justification Inheriting from ModelForm results in calling `clean()` on the resulting instance, which may not be desirable. See #11032 for an example where this is problematic.
adam added the type: housekeepingnetboxstatus: backlog labels 2025-12-29 20:26:08 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#7621