mirror of
https://github.com/pretix/pretix.git
synced 2026-08-09 10:37:50 +00:00
Fully block password change for non-native auth backend
This commit is contained in:
@@ -829,6 +829,9 @@ class UserPasswordChangeView(FormView):
|
||||
template_name = 'pretixcontrol/user/change_password.html'
|
||||
|
||||
def get_form_kwargs(self):
|
||||
if self.request.user.auth_backend != 'native':
|
||||
raise PermissionDenied
|
||||
|
||||
return {
|
||||
**super().get_form_kwargs(),
|
||||
"user": self.request.user,
|
||||
@@ -867,6 +870,9 @@ class UserEmailChangeView(RecentAuthenticationRequiredMixin, FormView):
|
||||
template_name = 'pretixcontrol/user/change_email.html'
|
||||
|
||||
def get_form_kwargs(self):
|
||||
if self.request.user.auth_backend != 'native':
|
||||
raise PermissionDenied
|
||||
|
||||
return {
|
||||
**super().get_form_kwargs(),
|
||||
"user": self.request.user,
|
||||
|
||||
Reference in New Issue
Block a user