forked from CGM_Public/pretix_original
Fix redirect loop caused when both 2fa and password change are forced (#3787)
This commit is contained in:
@@ -139,7 +139,7 @@ class PermissionMiddleware:
|
|||||||
return redirect_to_url(reverse('control:user.settings') + '?next=' + quote(request.get_full_path()))
|
return redirect_to_url(reverse('control:user.settings') + '?next=' + quote(request.get_full_path()))
|
||||||
|
|
||||||
if not request.user.require_2fa and settings.PRETIX_OBLIGATORY_2FA \
|
if not request.user.require_2fa and settings.PRETIX_OBLIGATORY_2FA \
|
||||||
and url_name not in self.EXCEPTIONS_2FA:
|
and url_name not in self.EXCEPTIONS_2FA and not request.user.needs_password_change:
|
||||||
return redirect_to_url(reverse('control:user.settings.2fa'))
|
return redirect_to_url(reverse('control:user.settings.2fa'))
|
||||||
|
|
||||||
if 'event' in url.kwargs and 'organizer' in url.kwargs:
|
if 'event' in url.kwargs and 'organizer' in url.kwargs:
|
||||||
|
|||||||
Reference in New Issue
Block a user