From 89e1563f683c620387c782c363d63f90abd46a33 Mon Sep 17 00:00:00 2001 From: Rodney Ewing Date: Tue, 21 May 2013 16:21:33 -0700 Subject: added support for user to change email address --- mediagoblin/edit/forms.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'mediagoblin/edit/forms.py') diff --git a/mediagoblin/edit/forms.py b/mediagoblin/edit/forms.py index 3b2486de..3a502263 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,6 +61,16 @@ class EditProfileForm(wtforms.Form): class EditAccountForm(wtforms.Form): + new_email = wtforms.TextField( + _('New email address'), + [wtforms.validators.Optional(), + normalize_user_or_email_field(allow_user=False)]) + password = wtforms.PasswordField( + _('Password'), + [wtforms.validators.Optional(), + wtforms.validators.Length(min=5, max=1024)], + description=_( + 'Enter your old password to prove you own this account.')) license_preference = wtforms.SelectField( _('License preference'), [ -- cgit v1.2.3 From f7698af1c118afa4f0db10cc0359d2b8b0e319b4 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Fri, 21 Jun 2013 17:24:33 -0500 Subject: Removing the "enter your password to change your email" bit. A good idea, though it feels fairly clumsy in the form, and I think if you're logged in you can already sabotage the user pretty well. This commit sponsored by Sergey Matveev. Thanks! --- mediagoblin/edit/forms.py | 6 ------ 1 file changed, 6 deletions(-) (limited to 'mediagoblin/edit/forms.py') diff --git a/mediagoblin/edit/forms.py b/mediagoblin/edit/forms.py index 3a502263..24b31a76 100644 --- a/mediagoblin/edit/forms.py +++ b/mediagoblin/edit/forms.py @@ -65,12 +65,6 @@ class EditAccountForm(wtforms.Form): _('New email address'), [wtforms.validators.Optional(), normalize_user_or_email_field(allow_user=False)]) - password = wtforms.PasswordField( - _('Password'), - [wtforms.validators.Optional(), - wtforms.validators.Length(min=5, max=1024)], - description=_( - 'Enter your old password to prove you own this account.')) license_preference = wtforms.SelectField( _('License preference'), [ -- cgit v1.2.3 From 1e21471a8abbf3f9d0d0e16a0f2c83c22ffe9650 Mon Sep 17 00:00:00 2001 From: Rodney Ewing Date: Tue, 25 Jun 2013 15:50:31 -0700 Subject: added feature to render_divs where if field.label == '' then it will render form.description the same a render_label --- mediagoblin/edit/forms.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'mediagoblin/edit/forms.py') diff --git a/mediagoblin/edit/forms.py b/mediagoblin/edit/forms.py index 24b31a76..e0147a0c 100644 --- a/mediagoblin/edit/forms.py +++ b/mediagoblin/edit/forms.py @@ -65,6 +65,9 @@ class EditAccountForm(wtforms.Form): _('New email address'), [wtforms.validators.Optional(), normalize_user_or_email_field(allow_user=False)]) + wants_comment_notification = wtforms.BooleanField( + label='', + description=_("Email me when others comment on my media")) license_preference = wtforms.SelectField( _('License preference'), [ @@ -73,8 +76,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): -- cgit v1.2.3