Skip to content
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

Ref #613 -- Handle unauthenticated users in hijack views #629

Merged
merged 1 commit into from Dec 11, 2023
Merged

Ref #613 -- Handle unauthenticated users in hijack views #629

merged 1 commit into from Dec 11, 2023

Conversation

alexei
Copy link
Contributor

@alexei alexei commented Dec 5, 2023

If the user is not authenticated, LockUserTableMixin.dispatch raises User.DoesNotExist. This started happening after a36fbb8:

get_user_model()._base_manager.select_for_update().get(pk=request.user.pk)

To address it, I changed the parent classes order so LoginRequiredMixin does its job first.

Copy link
Collaborator

@codingjoe codingjoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, thanks @alexei !

@codingjoe codingjoe changed the title fix: order of LoginRequiredMixin parent class Ref #613 -- Handle unauthenticated users in hijack views Dec 11, 2023
@codingjoe codingjoe merged commit 8e32946 into django-hijack:master Dec 11, 2023
25 checks passed
@codingjoe codingjoe added the bug label Dec 11, 2023
@codingjoe codingjoe self-assigned this Dec 11, 2023
@alexei alexei deleted the fix-require_authentication branch December 11, 2023 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants