aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/edit/forms.py
diff options
context:
space:
mode:
Diffstat (limited to 'mediagoblin/edit/forms.py')
-rw-r--r--mediagoblin/edit/forms.py36
1 files changed, 22 insertions, 14 deletions
diff --git a/mediagoblin/edit/forms.py b/mediagoblin/edit/forms.py
index ef270237..85c243a0 100644
--- a/mediagoblin/edit/forms.py
+++ b/mediagoblin/edit/forms.py
@@ -16,9 +16,11 @@
import wtforms
-from mediagoblin.tools.text import tag_length_validator, TOO_LONG_TAG_WARNING
+from mediagoblin.tools.text import tag_length_validator
from mediagoblin.tools.translate import lazy_pass_to_ugettext as _
from mediagoblin.tools.licenses import licenses_as_choices
+from mediagoblin.auth.forms import normalize_user_or_email_field
+
class EditForm(wtforms.Form):
title = wtforms.TextField(
@@ -59,17 +61,12 @@ class EditProfileForm(wtforms.Form):
class EditAccountForm(wtforms.Form):
- old_password = wtforms.PasswordField(
- _('Old password'),
- description=_(
- "Enter your old password to prove you own this account."))
- new_password = wtforms.PasswordField(
- _('New password'),
- [
- wtforms.validators.Optional(),
- wtforms.validators.Length(min=6, max=30)
- ],
- id="password")
+ new_email = wtforms.TextField(
+ _('New email address'),
+ [wtforms.validators.Optional(),
+ normalize_user_or_email_field(allow_user=False)])
+ wants_comment_notification = wtforms.BooleanField(
+ description=_("Email me when others comment on my media"))
license_preference = wtforms.SelectField(
_('License preference'),
[
@@ -78,8 +75,6 @@ class EditAccountForm(wtforms.Form):
],
choices=licenses_as_choices(),
description=_('This will be your default license on upload forms.'))
- wants_comment_notification = wtforms.BooleanField(
- label=_("Email me when others comment on my media"))
class EditAttachmentsForm(wtforms.Form):
@@ -103,3 +98,16 @@ class EditCollectionForm(wtforms.Form):
description=_(
"The title part of this collection's address. "
"You usually don't need to change this."))
+
+
+class ChangePassForm(wtforms.Form):
+ old_password = wtforms.PasswordField(
+ _('Old password'),
+ [wtforms.validators.Required()],
+ description=_(
+ "Enter your old password to prove you own this account."))
+ new_password = wtforms.PasswordField(
+ _('New password'),
+ [wtforms.validators.Required(),
+ wtforms.validators.Length(min=6, max=30)],
+ id="password")