prepare_cloned_fields()
should check for cloning support on model
#18500
Labels
severity: low
Does not significantly disrupt application functionality, or a workaround is available
status: needs owner
This issue is tentatively accepted pending a volunteer committed to its implementation
type: bug
A confirmed report of unexpected behavior in the application
Deployment Type
NetBox Cloud
NetBox Version
v4.2.2
Python Version
3.10
Steps to Reproduce
clone()
method on a plugin model, returning None.Expected Behavior
The object should render successfully.
Observed Behavior
An unhandled
AttributeError
exception is raised:This is because NetBox expects the
clone()
method, if defined on a model, to return a set of attributes suitable for pre-populating the creation form for the model. However, a plugin author might want to introduce aclone()
method for unrelated reasons.NetBox should inspect the model and attempt to call
clone()
only for models which inherit fromCloningMixin
.The text was updated successfully, but these errors were encountered: