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 May 21, 2024
1 parent 6544c6d commit 695fab4
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 @@ -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

Check failure on line 6 in dojo/group/utils.py

View workflow job for this annotation

GitHub Actions / ruff-linting

Ruff (F811)

dojo/group/utils.py:6:25: F811 Redefinition of unused `settings` from line 2

Check notice on line 6 in dojo/group/utils.py

View workflow job for this annotation

GitHub Actions / flake8-your-pr

dojo/group/utils.py#L6

redefinition of unused 'settings' from line 2 (F811)
from dojo.models import Dojo_Group, Dojo_Group_Member, Role


def get_auth_group_name(group, attempt=0):

Check failure on line 10 in dojo/group/utils.py

View workflow job for this annotation

GitHub Actions / ruff-linting

Ruff (I001)

dojo/group/utils.py:1:1: I001 Import block is un-sorted or un-formatted
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 695fab4

Please sign in to comment.