netbox
netbox copied to clipboard
false positive related object in custom fields
Deployment Type
Self-hosted
NetBox Version
v3.7.4
Python Version
3.10
Steps to Reproduce
- Create new custom field.
- Try to delete the newly created custom field.
- There is a message that the related object "CustomField_content_types object (n)" will also get deleted.
Expected Behavior
Newly created custom field isn't bound to any object, so user should get simple delete confirmation dialog without related objects.
Observed Behavior
User gets delete confirmation dialog with related objects even though those kinds of objects don't exist.
Another observation, don't know if it is this issue related: During the upgrade procedure to the feature branch, I get the following error mentioning the customfield_content_types:
File "/opt/netbox/venv/lib/python3.10/site-packages/psycopg/cursor.py", line 732, in execute
raise ex.with_traceback(None)
django.db.utils.ProgrammingError: relation "extras_customfield_content_types_id_seq" does not exist
User gets delete confirmation dialog with related objects even though those kinds of objects don't exist.
This is not that it is bound to a specific object, it is just stating that the custom field has a relation to the django content type table.
Technically, it is not incorrect, but I agree we should probably exempt the contenttype field from the relationship check on deletion, at least for this specific case.
Thanks for clarification Dan.
Did you check, whether it has something to do with the failure of the upgrade to the feature branch?
Did you check, whether it has something to do with the failure of the upgrade to the feature branch?
This would have nothing to do with it.
Please try a fresh upgrade and let us know if this fails still by opening a new bug.
Thank you Dan. I just tried the upgrade from 3.7.4 as well from 3.6.9 to new v4.0-beta1 and got the same error, so it seems it has nothing to do with it. I will open a new bug issue.
Could you please assign it to me?