Skip to content

Delete duplicate comment, improve docstring #418

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions djangosaml2/backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def get_or_create_user(
attribute_mapping: dict,
request,
) -> tuple[Optional[settings.AUTH_USER_MODEL], bool]:
"""Look up the user to authenticate. If he doesn't exist, this method creates him (if so desired).
"""Look up the user to authenticate. If they doesn't exist, this method creates them (if so desired).
The default implementation looks only at the user_identifier. Override this method in order to do more complex behaviour,
e.g. customize this per IdP.
"""
Expand All @@ -277,7 +277,6 @@ def get_or_create_user(
): user_lookup_value
}

# Lookup existing user
# Lookup existing user
user, created = None, False
try:
Expand Down
2 changes: 1 addition & 1 deletion djangosaml2/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class IdentityCache(Cache):
logged in.

This information is useful because when the user logs out we must
know where does he come from in order to notify such IdP/AA.
know where does they come from in order to notify such IdP/AA.

The current implementation stores this information in the Django session.
"""
Expand Down
8 changes: 4 additions & 4 deletions djangosaml2/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,10 @@ def add_idp_hinting(self, http_response):

def should_prevent_auth(self, request) -> bool:
# If the user is already authenticated that maybe because of two reasons:
# A) He has this URL in two browser windows and in the other one he
# has already initiated the authenticated session.
# B) He comes from a view that (incorrectly) send him here because
# he does not have enough permissions. That view should have shown
# A) They have this URL in two browser windows and in the other one they
# have already initiated the authenticated session.
# B) They comes from a view that (incorrectly) sends them here because
# they do not have enough permissions. That view should have shown
# an authorization error in the first place.
return request.user.is_authenticated

Expand Down