Fixed a fatal error causing mediagoblin to crash when certain types of media
authorNatalie Foust-Pilcher <natalie.foust.pilcher@gmail.com>
Thu, 12 Jun 2014 18:12:34 +0000 (14:12 -0400)
committerNatalie Foust-Pilcher <natalie.foust.pilcher@gmail.com>
Thu, 12 Jun 2014 18:12:34 +0000 (14:12 -0400)
were uploaded

mediagoblin/plugins/metadata_display/lib.py

index 0985208c8f57e45f1c0679a5284ba2be38f12728..2530d00f40c0165d03e33923321d581492a37cca 100644 (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):