Skip to content

Commit

Permalink
Simplify Expression
Browse files Browse the repository at this point in the history
  • Loading branch information
diogosilva30 committed Oct 28, 2022
1 parent 4f8cb8e commit 882c463
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/django_keycloak/backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,7 @@ def authenticate(
# `create_from_token` takes cares of password hashing
user = User.objects.create_from_token(token)

if token.is_superuser:
user.is_staff = user.is_superuser = True
else:
user.is_staff = user.is_superuser = False
user.is_staff = user.is_superuser = bool(token.is_superuser)

user.save()
return user
Expand Down

0 comments on commit 882c463

Please sign in to comment.