diff options
author | Elrond <elrond+mediagoblin.org@samba-tng.org> | 2012-01-21 19:24:36 +0100 |
---|---|---|
committer | Elrond <elrond+mediagoblin.org@samba-tng.org> | 2012-01-21 19:24:36 +0100 |
commit | 3c351460e1dbed9e789e363f1d5635160bce8d84 (patch) | |
tree | ee439d6076eb78180e4d0e0f63de931e3e523118 | |
parent | c8035da197f9ada5279e9198ac4ee4dcd8ca4da1 (diff) | |
download | mediagoblin-3c351460e1dbed9e789e363f1d5635160bce8d84.tar.lz mediagoblin-3c351460e1dbed9e789e363f1d5635160bce8d84.tar.xz mediagoblin-3c351460e1dbed9e789e363f1d5635160bce8d84.zip |
Fix unit tests with new license support
Make the license field in the forms optional and let them
properly be defaulted to "".
-rw-r--r-- | mediagoblin/edit/forms.py | 1 | ||||
-rw-r--r-- | mediagoblin/edit/views.py | 4 | ||||
-rw-r--r-- | mediagoblin/submit/forms.py | 1 | ||||
-rw-r--r-- | mediagoblin/submit/views.py | 4 |
4 files changed, 4 insertions, 6 deletions
diff --git a/mediagoblin/edit/forms.py b/mediagoblin/edit/forms.py index d49b9b28..3e3612fe 100644 --- a/mediagoblin/edit/forms.py +++ b/mediagoblin/edit/forms.py @@ -42,6 +42,7 @@ class EditForm(wtforms.Form): "You usually don't need to change this.")) license = wtforms.SelectField( _('License'), + [wtforms.validators.Optional(),], choices=licenses_as_choices()) class EditProfileForm(wtforms.Form): diff --git a/mediagoblin/edit/views.py b/mediagoblin/edit/views.py index cffb8a3c..62684dcf 100644 --- a/mediagoblin/edit/views.py +++ b/mediagoblin/edit/views.py @@ -75,9 +75,7 @@ def edit_media(request, media): media.description_html = cleaned_markdown_conversion( media.description) - media.license = ( - unicode(request.POST.get('license')) - or '') + media.license = unicode(request.POST.get('license', '')) media.slug = unicode(request.POST['slug']) diff --git a/mediagoblin/submit/forms.py b/mediagoblin/submit/forms.py index 4ff52609..1ff59c18 100644 --- a/mediagoblin/submit/forms.py +++ b/mediagoblin/submit/forms.py @@ -39,4 +39,5 @@ class SubmitStartForm(wtforms.Form): "Separate tags by commas.")) license = wtforms.SelectField( _('License'), + [wtforms.validators.Optional(),], choices=licenses_as_choices()) diff --git a/mediagoblin/submit/views.py b/mediagoblin/submit/views.py index 8911bf82..832203a4 100644 --- a/mediagoblin/submit/views.py +++ b/mediagoblin/submit/views.py @@ -69,9 +69,7 @@ def submit_start(request): entry.description_html = cleaned_markdown_conversion( entry.description) - entry.license = ( - unicode(request.POST.get('license')) - or '') + entry.license = unicode(request.POST.get('license', '')) entry.uploader = request.user._id |