First crack at basic license support.

This commit is contained in:
Aaron Williamson
2012-01-17 00:33:55 -05:00
parent 98308e61b6
commit 25b48323a8
6 changed files with 30 additions and 3 deletions

View File

@@ -19,7 +19,7 @@ import wtforms
from mediagoblin.tools.text import tag_length_validator
from mediagoblin.tools.translate import fake_ugettext_passthrough as _
from mediagoblin.tools.licenses import licenses_as_choices
class SubmitStartForm(wtforms.Form):
file = wtforms.FileField(_('File'))
@@ -31,3 +31,6 @@ class SubmitStartForm(wtforms.Form):
tags = wtforms.TextField(
_('Tags'),
[tag_length_validator])
license = wtforms.SelectField(
_('License'),
choices=licenses_as_choices())

View File

@@ -60,6 +60,10 @@ def submit_start(request):
entry['description'] = unicode(request.POST.get('description'))
entry['description_html'] = cleaned_markdown_conversion(
entry['description'])
entry['license'] = (
unicode(request.POST.get('license'))
or '')
entry['media_type'] = u'image' # heh
entry['uploader'] = request.user['_id']