diff options
author | Rodney Ewing <ewing.rj@gmail.com> | 2013-05-03 08:50:30 -0700 |
---|---|---|
committer | Rodney Ewing <ewing.rj@gmail.com> | 2013-05-24 16:51:27 -0700 |
commit | ee355966c84fb32541b3940eee6adae15c89cc19 (patch) | |
tree | afca76446aaa476874b9d1a76a6c3ccf09f176a9 /mediagoblin/plugins/basic_auth/forms.py | |
parent | b75eb88fabdac4a9fdc863969ec9472110732607 (diff) | |
download | mediagoblin-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.py | 30 |
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)]) |