-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Devices > Edit: (get() returned more than one Device) when using multi custom permissions by tags #8715
Comments
See also #8351 |
if added to the call netbox/netbox/utilities/querysets.py Line 42 in 90ee689
.distinct() the error disappears, but I'm not sure if this is the right way to solve it and it won't break anything. |
Seems like a bug with the
|
From: https://django-taggit.readthedocs.io/en/latest/api.html#filtering: If you’re filtering on multiple tags, it’s very common to get duplicate results, because of the way relational databases work. Often you’ll want to make use of the distinct() method on QuerySets:
|
Fixes #8715: eliminates duplicates when used in many-to-many field constraints
NetBox version
v3.1.8 (netbox-docker)
Python version
3.9
Steps to Reproduce
Expected Behavior
The form for editing the device will open.
Observed Behavior
Exception Type: MultipleObjectsReturned at /dcim/devices/1/edit/
Exception Value: get() returned more than one Device -- it returned 2!
Detail:
The text was updated successfully, but these errors were encountered: