Fixed a fatal error causing mediagoblin to crash when certain types of media

were uploaded
This commit is contained in:
Natalie Foust-Pilcher 2014-06-12 14:12:34 -04:00
parent 9f84506885
commit 32ba7efcfc

View File

@ -19,7 +19,11 @@ def rdfa_to_readable(rdfa_predicate):
A simple script to convert rdfa resource descriptors into a form more
accessible for humans.
"""
readable = rdfa_predicate.split(u":")[1].capitalize()
components = rdfa_predicate.split(u":")
if len(components) >= 2:
readable = [1].capitalize()
else:
readable = u""
return readable
def add_rdfa_to_readable_to_media_home(context):