summaryrefslogtreecommitdiffstats
path: root/accounts/forms.py
diff options
context:
space:
mode:
Diffstat (limited to 'accounts/forms.py')
-rw-r--r--accounts/forms.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/accounts/forms.py b/accounts/forms.py
index 8653653..82b999e 100644
--- a/accounts/forms.py
+++ b/accounts/forms.py
@@ -1,11 +1,16 @@
# -*- coding: utf-8 -*-
+import re
from flask import g, current_app, session, Markup
from flask.ext.wtf import Form
from flask.ext.login import current_user
from wtforms import TextField, PasswordField, ValidationError, BooleanField,\
validators
from wtforms.form import FormMeta
-from utils import _username_re, _username_exclude_re, NotRegexp, url_for
+from utils import NotRegexp, url_for
+
+
+_username_re = re.compile(r'^[a-zA-Z][a-zA-Z0-9-]{1,15}$')
+_username_exclude_re = re.compile(r'^(admin|root)')
class RegisterForm(Form):