aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/plugins/basic_auth/forms.py
diff options
context:
space:
mode:
authorRodney Ewing <ewing.rj@gmail.com>2013-05-03 08:50:30 -0700
committerRodney Ewing <ewing.rj@gmail.com>2013-05-24 16:51:27 -0700
commitee355966c84fb32541b3940eee6adae15c89cc19 (patch)
treeafca76446aaa476874b9d1a76a6c3ccf09f176a9 /mediagoblin/plugins/basic_auth/forms.py
parentb75eb88fabdac4a9fdc863969ec9472110732607 (diff)
downloadmediagoblin-ee355966c84fb32541b3940eee6adae15c89cc19.tar.lz
mediagoblin-ee355966c84fb32541b3940eee6adae15c89cc19.tar.xz
mediagoblin-ee355966c84fb32541b3940eee6adae15c89cc19.zip
basic_auth v0 plugin working
Diffstat (limited to 'mediagoblin/plugins/basic_auth/forms.py')
-rw-r--r--mediagoblin/plugins/basic_auth/forms.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/mediagoblin/plugins/basic_auth/forms.py b/mediagoblin/plugins/basic_auth/forms.py
new file mode 100644
index 00000000..28eb7d0a
--- /dev/null
+++ b/mediagoblin/plugins/basic_auth/forms.py
@@ -0,0 +1,30 @@
+import wtforms
+
+from mediagoblin.tools.translate import lazy_pass_to_ugettext as _
+from mediagoblin.auth.forms import normalize_user_or_email_field
+
+
+class RegistrationForm(wtforms.Form):
+ username = wtforms.TextField(
+ _('Username'),
+ [wtforms.validators.Required(),
+ normalize_user_or_email_field(allow_email=False)])
+ password = wtforms.PasswordField(
+ _('Password'),
+ [wtforms.validators.Required(),
+ wtforms.validators.Length(min=5, max=1024)])
+ email = wtforms.TextField(
+ _('Email address'),
+ [wtforms.validators.Required(),
+ normalize_user_or_email_field(allow_user=False)])
+
+
+class LoginForm(wtforms.Form):
+ username = wtforms.TextField(
+ _('Username or Email'),
+ [wtforms.validators.Required(),
+ normalize_user_or_email_field()])
+ password = wtforms.PasswordField(
+ _('Password'),
+ [wtforms.validators.Required(),
+ wtforms.validators.Length(min=5, max=1024)])