Skip to content

Commit

Permalink
Update services.py
Browse files Browse the repository at this point in the history
  • Loading branch information
untitledds authored Dec 1, 2024
1 parent cd59fa6 commit 019eb3c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions back/taiga_contrib_access_token_auth/services.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import logging
import os
from django.db import transaction as tx
from django.apps import apps
from django.conf import settings
Expand Down Expand Up @@ -61,8 +60,11 @@ def access_token_register(
if groups:
user.groups.set(groups)
logger.info(f"Groups assigned to user: {email}, groups: {groups}")
else:
user.groups.set([settings.GROUPS["WATCHERS"]])
logger.info(f"Default group 'Watchers' assigned to user: {email}")

default_role = determine_role(groups)
default_role = determine_role(groups) if groups else settings.ROLES["MEMBER"]
membership_model.objects.create(user=user, role=default_role, project_id=project_id)
logger.info(f"Role assigned to user: {email}, role: {default_role}, project_id: {project_id}")

Expand Down

0 comments on commit 019eb3c

Please sign in to comment.