summaryrefslogtreecommitdiffstats
path: root/forms.py
diff options
context:
space:
mode:
Diffstat (limited to 'forms.py')
-rw-r--r--forms.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/forms.py b/forms.py
index 59da874..a65d45c 100644
--- a/forms.py
+++ b/forms.py
@@ -31,6 +31,15 @@ class RegisterForm(Form):
#TODO
pass
+class AdminCreateAccountForm(RegisterForm):
+ def validate_username(form, field):
+ try:
+ g.ldap.get_by_uid(field.data)
+ except NoSuchUserError:
+ return
+ else:
+ raise ValidationError(u'Dieser Benutzername ist schon vergeben')
+
class RegisterCompleteForm(Form):
password = PasswordField('Passwort', [validators.Required(),