def get_license_data(self):
"""Return license dict for requested license"""
- return licenses.SUPPORTED_LICENSES[self.license]
+ return licenses.SUPPORTED_LICENSES[self.license or ""]
"""
Add the 'license' field for entries that don't have it.
"""
- add_table_field(database, 'media_entries', 'license', '')
+ add_table_field(database, 'media_entries', 'license', None)
description_html = Column(UnicodeText) # ??
media_type = Column(Unicode, nullable=False)
state = Column(Unicode, nullable=False) # or use sqlalchemy.types.Enum?
- license = Column(Unicode, nullable=False)
+ license = Column(Unicode)
fail_error = Column(Unicode)
fail_metadata = Column(UnicodeText)
media.description_html = cleaned_markdown_conversion(
media.description)
- media.license = unicode(request.POST.get('license', ''))
+ media.license = unicode(request.POST.get('license')) or None
media.slug = unicode(request.POST['slug'])
entry.description_html = cleaned_markdown_conversion(
entry.description)
- entry.license = unicode(request.POST.get('license', ''))
+ entry.license = unicode(request.POST.get('license', "")) or None
entry.uploader = request.user._id