Skip to content

Commit

Permalink
Update django_auth_adfs/backend.py
Browse files Browse the repository at this point in the history
The data income will be always a string so we can simplify this if statement

Co-authored-by: Sondre Lillebø Gundersen <[email protected]>
  • Loading branch information
Seykotron and sondrelg authored Mar 25, 2021
1 parent 5ec79f0 commit b17fc45
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion django_auth_adfs/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def create_user(self, claims):
username_claim = settings.USERNAME_CLAIM
usermodel = get_user_model()

if claims.get(username_claim, None) is None:
if not claims.get(username_claim):
logger.error("User claim's doesn't have the claim '%s' in his claims: %s" % (username_claim, claims))
raise PermissionDenied
userdata = {usermodel.USERNAME_FIELD: claims[username_claim]}
Expand Down

0 comments on commit b17fc45

Please sign in to comment.