mirror of
https://github.com/pretix/pretix.git
synced 2026-05-03 14:54:04 +00:00
Fixes #127 -- Leave SMTP password unchanged if not provided
This commit is contained in:
@@ -264,6 +264,14 @@ class MailSettingsForm(SettingsForm):
|
||||
required=False
|
||||
)
|
||||
|
||||
def clean(self):
|
||||
data = self.cleaned_data
|
||||
if not data.get('smtp_password') and data.get('smtp_username'):
|
||||
# Leave password unchanged if the username is set and the password field is empty.
|
||||
# This makes it impossible to set an empty password as long as a username is set, but
|
||||
# Python's smtplib does not support password-less schemes anyway.
|
||||
data['smtp_password'] = self.initial.get('smtp_password')
|
||||
|
||||
|
||||
class TicketSettingsForm(SettingsForm):
|
||||
ticket_download = forms.BooleanField(
|
||||
|
||||
Reference in New Issue
Block a user