'Group' object has no attribute 'user_set' #9658

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

Originally created by @CTV-2023 on GitHub (May 12, 2024).

Deployment Type

Self-hosted

NetBox Version

v4.0.0

Python Version

3.11

Steps to Reproduce

Hi,

Following this discussion
https://github.com/netbox-community/netbox/discussions/16000
I think I found a regression or missing feature between Django user/group models and Netbox models

If in a custom pipeline, calling netbox authentication model with
from netbox.authentication import Group

I can't add users to a group with group.user_set.add(user)

<class 'AttributeError'>

'Group' object has no attribute 'user_set'

I can still add groups to a user with user.groups.add(group)

(many to many relationship issue ?)

Expected Behavior

I should be able to add users to a group, like I can add groups to user

Observed Behavior

Regression from Django

Originally created by @CTV-2023 on GitHub (May 12, 2024). ### Deployment Type Self-hosted ### NetBox Version v4.0.0 ### Python Version 3.11 ### Steps to Reproduce Hi, Following this discussion https://github.com/netbox-community/netbox/discussions/16000 I think I found a regression or missing feature between Django user/group models and Netbox models If in a custom pipeline, calling netbox authentication model with `from netbox.authentication import Group` I can't add users to a group with group.user_set.add(user) > <class 'AttributeError'> > 'Group' object has no attribute 'user_set' I can still add groups to a user with user.groups.add(group) (many to many relationship issue ?) ### Expected Behavior I should be able to add users to a group, like I can add groups to user ### Observed Behavior Regression from Django
adam closed this issue 2025-12-29 21:20:32 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9658