Skip to content

Commit

Permalink
fix CI on group auto provisioning
Browse files Browse the repository at this point in the history
  • Loading branch information
delcroip committed Jun 3, 2024
1 parent a5003fc commit 2147ab0
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions core/models/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,13 @@ def auto_provision_user(self, **kwargs):
user.i_user = i_user
user.save()
if core.auto_provisioning_user_group:
group = Group.objects.get(
name=core.auto_provisioning_user_group)
user_group = UserGroup(user=user, group=group)
user_group.save()
group = Group.objects.filter(
name=core.auto_provisioning_user_group).first()
if group:
user_group = UserGroup(user=user, group=group)
user_group.save()
else:
logger.error(f"Group {core.auto_provisioning_user_group} was not found")
return user, True

def get_or_create(self, **kwargs):
Expand Down

0 comments on commit 2147ab0

Please sign in to comment.