You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Starting with Netbox v4.0.x , the "Group" in similiar statement of kinds of customized sso_pipeline_roles.py is empty if it is from "from django.contrib.auth.models import Group"
from django.contrib.auth.models import Group
groups = Group.objects.all()
#Debug
print("All available groups in Netbox setting: ")
print(groups)
The Group is empty. As Group is empty, any logic iterating over this Emply group and adding user to each returned group item will break.
#Group is empty, so groups is empty
groups = Group.objects.all()
#group is empty
for group in groups:
try:
if group.name in roles:
group.user_set.add(user) # can't user_set.add() for empty group
else:
group.user_set.remove(user)
except Group.DoesNotExist:
continue
May 15, 2024 at 10:52 (UTC+2:00) | All available groups in Netbox setting: | netbox-container
May 15, 2024 at 10:52 (UTC+2:00) | <QuerySet []> | netbox-container
The text was updated successfully, but these errors were encountered:
marsteel
changed the title
sso_pipeline_roles.py fix in develop/docs/auth.md
sso_pipeline_roles.py fix for Netbox v4.0.0 in develop/docs/auth.md
May 15, 2024
[netbox-chart/docs
/auth.md](https://github.com/netbox-community/netbox-chart/blob/develop/docs/auth.md)
The sso_pipeline_roles.py will break for >Netbox v4.0.0
Please refer to thread netbox-community/netbox#9635 (reply in thread)
Starting with Netbox v4.0.x , the "Group" in similiar statement of kinds of customized sso_pipeline_roles.py is empty if it is from "from django.contrib.auth.models import Group"
from django.contrib.auth.models import Group
groups = Group.objects.all()
#Debug
print("All available groups in Netbox setting: ")
print(groups)
The Group is empty. As Group is empty, any logic iterating over this Emply group and adding user to each returned group item will break.
May 15, 2024 at 10:52 (UTC+2:00) | All available groups in Netbox setting: | netbox-container
May 15, 2024 at 10:52 (UTC+2:00) | <QuerySet []> | netbox-container
The text was updated successfully, but these errors were encountered: