Fix password recovery even when reset is disabled

This commit is contained in:
Raphael Michel
2023-11-20 11:36:41 +01:00
parent 65dbf03a12
commit 6f6def88a3

View File

@@ -322,7 +322,8 @@ class Recover(TemplateView):
}
def dispatch(self, request, *args, **kwargs):
if not settings.PRETIX_PASSWORD_RESET or 'native' not in get_auth_backends():
# settings.PRETIX_PASSWORD_RESET is not checked here to allow admin-sent recovery links
if 'native' not in get_auth_backends():
raise PermissionDenied('Registration is disabled')
return super().dispatch(request, *args, **kwargs)