aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/edit/forms.py
diff options
context:
space:
mode:
authorMark Holmquist <mtraceur@member.fsf.org>2012-11-10 16:59:37 -0800
committerSebastian Spaeth <Sebastian@SSpaeth.de>2013-01-17 21:34:04 +0100
commitdc4dfbde350fdd9eac50448e42f2c8b209dd6ea8 (patch)
treee46b401ad1cfb2aab400658491ed2975f23ff61a /mediagoblin/edit/forms.py
parent49745d5138540af8f7cbce318767172f4c560881 (diff)
downloadmediagoblin-dc4dfbde350fdd9eac50448e42f2c8b209dd6ea8.tar.lz
mediagoblin-dc4dfbde350fdd9eac50448e42f2c8b209dd6ea8.tar.xz
mediagoblin-dc4dfbde350fdd9eac50448e42f2c8b209dd6ea8.zip
Add a license preference field
This feature is absolutely necessary. Now a user can simply define their default license and quickly go through a form, as opposed to stopping to click on the select and choosing the same option over and over again. Also added DB migration for the field, so that's working now, too. Rebased by Sebastian and made the default value to be unicode. Reviewed-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Diffstat (limited to 'mediagoblin/edit/forms.py')
-rw-r--r--mediagoblin/edit/forms.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/mediagoblin/edit/forms.py b/mediagoblin/edit/forms.py
index 293c3bb2..2673967b 100644
--- a/mediagoblin/edit/forms.py
+++ b/mediagoblin/edit/forms.py
@@ -65,8 +65,19 @@ class EditAccountForm(wtforms.Form):
"Enter your old password to prove you own this account."))
new_password = wtforms.PasswordField(
_('New password'),
- [wtforms.validators.Length(min=6, max=30)],
+ [
+ wtforms.validators.Optional(),
+ wtforms.validators.Length(min=6, max=30)
+ ],
id="password")
+ license_preference = wtforms.SelectField(
+ _('License preference'),
+ [
+ wtforms.validators.Optional(),
+ wtforms.validators.AnyOf([lic[0] for lic in licenses_as_choices()]),
+ ],
+ 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"))