summaryrefslogtreecommitdiffstats
path: root/forms.py
diff options
context:
space:
mode:
Diffstat (limited to 'forms.py')
-rw-r--r--forms.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/forms.py b/forms.py
index a58f98b..75f7be1 100644
--- a/forms.py
+++ b/forms.py
@@ -43,6 +43,11 @@ class SettingsForm(Form):
password_confirm = PasswordField(u'Passwort bestätigen')
mail = TextField('E-Mail-Adresse', [validators.Optional(), validators.Email(), validators.Length(min=6, max=50)])
+ def validate_mail(form, field):
+ results = g.ldap.find_by_mail(field.data)
+ for user in results:
+ if user.uid != g.user.uid:
+ raise ValidationError(u'Diese E-Mail-Adresse wird schon von einem anderen account benutzt!')
def get_servicepassword(self, service_id):
return getattr(self, 'password_%s' % service_id)