can_add()
template filter raises exception when passing a model
#15025
Labels
severity: low
Does not significantly disrupt application functionality, or a workaround is available
status: accepted
This issue has been accepted for implementation
type: bug
A confirmed report of unexpected behavior in the application
Deployment Type
NetBox Cloud
NetBox Version
v3.7.1
Python Version
3.11
Steps to Reproduce
There is an issue with how the
can_add()
filter evaluates permissions. It should expect to receive a model rather than a specific instance (as an existing instance obviously cannot be create again). The following template code fails:Below is a reconstruction using the Python shell:
Expected Behavior
Passing a model to the
can_add()
filter should successfully evaluate the user's permission to create a new instance of that model.Observed Behavior
A
TypeError
exception is raised.The text was updated successfully, but these errors were encountered: