Skip to content

Commit

Permalink
reverted and amended the groups check
Browse files Browse the repository at this point in the history
  • Loading branch information
lme-nca committed Apr 24, 2024
1 parent 9624f52 commit 1a1ec7b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dojo/group/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
from django.contrib.auth.models import Group
from django.db.models.signals import post_save, post_delete
from django.dispatch import receiver
from dojo.models import Dojo_Group, Dojo_Group_Member, Role, Dojo_User
from django.conf import settings
from dojo.models import Dojo_Group, Dojo_Group_Member, Role


def get_auth_group_name(group, attempt=0):
Expand Down Expand Up @@ -32,7 +33,7 @@ def group_post_save_handler(sender, **kwargs):
group.auth_group = auth_group
group.save()
user = get_current_user()
if user and isinstance(user, Dojo_User):
if user and not settings.AZUREAD_TENANT_OAUTH2_GET_GROUPS and not settings.KEYCLOAK_TENANT_OAUTH2_GET_GROUPS:
# Add the current user as the owner of the group
member = Dojo_Group_Member()
member.user = user
Expand Down

0 comments on commit 1a1ec7b

Please sign in to comment.