Fix unit tests with new license support
Make the license field in the forms optional and let them properly be defaulted to "".
This commit is contained in:
parent
c8035da197
commit
3c351460e1
@ -42,6 +42,7 @@ class EditForm(wtforms.Form):
|
|||||||
"You usually don't need to change this."))
|
"You usually don't need to change this."))
|
||||||
license = wtforms.SelectField(
|
license = wtforms.SelectField(
|
||||||
_('License'),
|
_('License'),
|
||||||
|
[wtforms.validators.Optional(),],
|
||||||
choices=licenses_as_choices())
|
choices=licenses_as_choices())
|
||||||
|
|
||||||
class EditProfileForm(wtforms.Form):
|
class EditProfileForm(wtforms.Form):
|
||||||
|
@ -75,9 +75,7 @@ def edit_media(request, media):
|
|||||||
media.description_html = cleaned_markdown_conversion(
|
media.description_html = cleaned_markdown_conversion(
|
||||||
media.description)
|
media.description)
|
||||||
|
|
||||||
media.license = (
|
media.license = unicode(request.POST.get('license', ''))
|
||||||
unicode(request.POST.get('license'))
|
|
||||||
or '')
|
|
||||||
|
|
||||||
media.slug = unicode(request.POST['slug'])
|
media.slug = unicode(request.POST['slug'])
|
||||||
|
|
||||||
|
@ -39,4 +39,5 @@ class SubmitStartForm(wtforms.Form):
|
|||||||
"Separate tags by commas."))
|
"Separate tags by commas."))
|
||||||
license = wtforms.SelectField(
|
license = wtforms.SelectField(
|
||||||
_('License'),
|
_('License'),
|
||||||
|
[wtforms.validators.Optional(),],
|
||||||
choices=licenses_as_choices())
|
choices=licenses_as_choices())
|
||||||
|
@ -69,9 +69,7 @@ def submit_start(request):
|
|||||||
entry.description_html = cleaned_markdown_conversion(
|
entry.description_html = cleaned_markdown_conversion(
|
||||||
entry.description)
|
entry.description)
|
||||||
|
|
||||||
entry.license = (
|
entry.license = unicode(request.POST.get('license', ''))
|
||||||
unicode(request.POST.get('license'))
|
|
||||||
or '')
|
|
||||||
|
|
||||||
entry.uploader = request.user._id
|
entry.uploader = request.user._id
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user