mirror of
https://github.com/pretix/pretix.git
synced 2026-05-14 16:44:06 +00:00
changing to same password as previous is already prevented by HistoryPasswordValidator
(would have to move this to UserPasswordChangeForm but decided to remove instead as it's redundant)
This commit is contained in:
@@ -78,21 +78,6 @@ class UserSettingsForm(forms.ModelForm):
|
||||
'link': reverse('control:user.settings.email.change')
|
||||
})
|
||||
|
||||
def clean(self):
|
||||
password1 = self.cleaned_data.get('new_pw')
|
||||
old_pw = self.cleaned_data.get('old_pw')
|
||||
|
||||
if password1 and password1 == old_pw:
|
||||
raise forms.ValidationError(
|
||||
self.error_messages['pw_equal'],
|
||||
code='pw_equal'
|
||||
)
|
||||
|
||||
if password1:
|
||||
self.instance.set_password(password1)
|
||||
|
||||
return self.cleaned_data
|
||||
|
||||
|
||||
class User2FADeviceAddForm(forms.Form):
|
||||
name = forms.CharField(label=_('Device name'), max_length=64)
|
||||
|
||||
Reference in New Issue
Block a user