Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

false positive related object in custom fields #15548

Closed
opericgithub opened this issue Mar 27, 2024 · 5 comments · Fixed by #15889
Closed

false positive related object in custom fields #15548

opericgithub opened this issue Mar 27, 2024 · 5 comments · Fixed by #15889
Assignees
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

Comments

@opericgithub
Copy link

Deployment Type

Self-hosted

NetBox Version

v3.7.4

Python Version

3.10

Steps to Reproduce

  1. Create new custom field.
  2. Try to delete the newly created custom field.
  3. 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

@opericgithub opericgithub added status: needs triage This issue is awaiting triage by a maintainer type: bug A confirmed report of unexpected behavior in the application labels Mar 27, 2024
@DanSheps DanSheps added severity: medium Results in substantial degraded or broken functionality for specfic workflows status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation severity: low Does not significantly disrupt application functionality, or a workaround is available and removed status: needs triage This issue is awaiting triage by a maintainer severity: medium Results in substantial degraded or broken functionality for specfic workflows labels Mar 28, 2024
@DanSheps
Copy link
Member

DanSheps commented Mar 28, 2024

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.

@DanSheps DanSheps removed their assignment Mar 28, 2024
@opericgithub

This comment was marked as off-topic.

@DanSheps

This comment was marked as off-topic.

@opericgithub

This comment was marked as off-topic.

@Julio-Oliveira-Encora
Copy link
Contributor

Could you please assign it to me?

@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation and removed status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation labels Apr 10, 2024
jeremystretch added a commit that referenced this issue Apr 29, 2024
jeremystretch added a commit that referenced this issue Apr 29, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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
Projects
None yet
4 participants