-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Labels
severity: lowDoes not significantly disrupt application functionality, or a workaround is availableDoes not significantly disrupt application functionality, or a workaround is availablestatus: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the applicationA confirmed report of unexpected behavior in the application
Milestone
Description
Deployment Type
NetBox Cloud
NetBox Version
v4.2.2
Python Version
3.10
Steps to Reproduce
- Define a
clone()
method on a plugin model, returning None. - Install the plugin.
- Attempt to view an instance of that model.
Expected Behavior
The object should render successfully.
Observed Behavior
An unhandled AttributeError
exception is raised:
'NoneType' object has no attribute 'items'
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 a clone()
method for unrelated reasons.
NetBox should inspect the model and attempt to call clone()
only for models which inherit from CloningMixin
.
Metadata
Metadata
Assignees
Labels
severity: lowDoes not significantly disrupt application functionality, or a workaround is availableDoes not significantly disrupt application functionality, or a workaround is availablestatus: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the applicationA confirmed report of unexpected behavior in the application