-
Notifications
You must be signed in to change notification settings - Fork 219
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
MultipleGroupRequiredMixin redirect loop when user doesn't have permissions #161
Comments
Indeed this is an issue for GroupRequiredMixin. If the user is already logged in but is not in the required group, the redirect to the login page causes a redirect loop. |
Hey @ahharu can you submit this as a pull request? Thanks! |
@ahharu are you working on this? I just ran into this issue. I might be able to work on it if you're not. |
@bcail I am sorry but currently we dropped the project where we were using it and don't have a spot to dig into a nice solution (and not a workaround like the one posted) |
ok, no problem. I actually found out that the raise_exception flag did what I needed it to. Seems like it would make sense to automatically raise the exception if the user is already logged in, but this flag fixed it enough for me. |
Hi! I posted a potential fix to this bug in issue #181. |
Instead of loading the same page the user was on with the error message it enters a redirect loop
[20/Jan/2015 09:44:03] "GET /projects/63/members/ HTTP/1.1" 302 0
[20/Jan/2015 09:44:03] "GET /login/?next=/projects/63/members/ HTTP/1.1" 302 0
[20/Jan/2015 09:44:03] "GET /projects/63/members/ HTTP/1.1" 302 0
[20/Jan/2015 09:44:03] "GET /login/?next=/projects/63/members/ HTTP/1.1" 302 0
[20/Jan/2015 09:44:03] "GET /projects/63/members/ HTTP/1.1" 302 0
[20/Jan/2015 09:44:04] "GET /login/?next=/projects/63/members/ HTTP/1.1" 302 0
[20/Jan/2015 09:44:04] "GET /projects/63/members/ HTTP/1.1" 302 0
[20/Jan/2015 09:44:04] "GET /login/?next=/projects/63/members/ HTTP/1.1" 302 0
[20/Jan/2015 09:44:04] "GET /projects/63/members/ HTTP/1.1" 302 0
[20/Jan/2015 09:44:04] "GET /login/?next=/projects/63/members/ HTTP/1.1" 302 0
[20/Jan/2015 09:44:04] "GET /projects/63/members/ HTTP/1.1" 302 0
[20/Jan/2015 09:44:04] "GET /login/?next=/projects/63/members/ HTTP/1.1" 302 0
[20/Jan/2015 09:44:04] "GET /projects/63/members/ HTTP/1.1" 302 0
[20/Jan/2015 09:44:04] "GET /login/?next=/projects/63/members/ HTTP/1.1" 302 0
I solved it as follows, please check
class MultipleGroupRequiredMixin(GroupRequiredMixin):
The text was updated successfully, but these errors were encountered: