From 695fab4cb4377c05e1ac8320165ce55d8aba9fb3 Mon Sep 17 00:00:00 2001 From: Lars Meijers Date: Wed, 24 Apr 2024 09:02:06 +0200 Subject: [PATCH] reverted and amended the groups check --- dojo/group/utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dojo/group/utils.py b/dojo/group/utils.py index fa2b076afbf..fb8dac2117f 100644 --- a/dojo/group/utils.py +++ b/dojo/group/utils.py @@ -3,7 +3,8 @@ from django.contrib.auth.models import Group from django.db.models.signals import post_delete, post_save 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): @@ -34,7 +35,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