TypeError when bulking editing ASNs with a site #6635

Closed
opened 2025-12-29 19:43:21 +01:00 by adam · 0 comments
Owner

Originally created by @cpmoves on GitHub (Jul 8, 2022).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v3.2.5

Python version

3.10

Steps to Reproduce

  1. Select multiple ASNs
  2. Click Edit Selected and select a site from the Sites drop down menu
  3. Click Apply

Expected Behavior

The site will be added to the select ASNs

Observed Behavior

TypeError at /ipam/asns/edit/
Direct assignment to the reverse side of a many-to-many set is prohibited. Use sites.set() instead.
Request Method: POST
Request URL: http://netbox/ipam/asns/edit/
Django Version: 4.0.5
Exception Type: TypeError
Exception Value:
Direct assignment to the reverse side of a many-to-many set is prohibited. Use sites.set() instead.
Exception Location: /opt/netbox-3.2.5/venv/lib/python3.10/site-packages/django/db/models/fields/related_descriptors.py, line 595, in set
Python Executable: /opt/netbox-3.2.5/venv/bin/python3.10
Python Version: 3.10.4
Python Path:
['/opt/netbox/netbox',
'/opt/netbox-3.2.5',
'/opt/netbox-3.2.5/venv/bin',
'/usr/local/python3/lib/python310.zip',
'/usr/local/python3/lib/python3.10',
'/usr/local/python3/lib/python3.10/lib-dynload',
'/opt/netbox-3.2.5/venv/lib/python3.10/site-packages']

Originally created by @cpmoves on GitHub (Jul 8, 2022). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v3.2.5 ### Python version 3.10 ### Steps to Reproduce 1. Select multiple ASNs 2. Click Edit Selected and select a site from the Sites drop down menu 3. Click Apply ### Expected Behavior The site will be added to the select ASNs ### Observed Behavior TypeError at /ipam/asns/edit/ Direct assignment to the reverse side of a many-to-many set is prohibited. Use sites.set() instead. Request Method: POST Request URL: http://netbox/ipam/asns/edit/ Django Version: 4.0.5 Exception Type: TypeError Exception Value: Direct assignment to the reverse side of a many-to-many set is prohibited. Use sites.set() instead. Exception Location: /opt/netbox-3.2.5/venv/lib/python3.10/site-packages/django/db/models/fields/related_descriptors.py, line 595, in __set__ Python Executable: /opt/netbox-3.2.5/venv/bin/python3.10 Python Version: 3.10.4 Python Path: ['/opt/netbox/netbox', '/opt/netbox-3.2.5', '/opt/netbox-3.2.5/venv/bin', '/usr/local/python3/lib/python310.zip', '/usr/local/python3/lib/python3.10', '/usr/local/python3/lib/python3.10/lib-dynload', '/opt/netbox-3.2.5/venv/lib/python3.10/site-packages']
adam added the type: bugstatus: accepted labels 2025-12-29 19:43:21 +01:00
adam closed this issue 2025-12-29 19:43:21 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#6635