]> git.parisson.com Git - timeside.git/commitdiff
Fix mime_type setting for Results
authorThomas Fillon <thomas@parisson.com>
Wed, 25 Mar 2015 15:14:17 +0000 (16:14 +0100)
committerThomas Fillon <thomas@parisson.com>
Wed, 25 Mar 2015 15:14:17 +0000 (16:14 +0100)
timeside/server/models.py

index 30d49da9053bf03d46a3e0dcebd2e4b9a70e3449..d488f51b3f83653369c6280b82f87c9275f8942d 100644 (file)
@@ -402,8 +402,9 @@ def set_mimetype(sender, **kwargs):
     instance = kwargs['instance']
     if instance.file:
         path = instance.file.path
-    elif instance.url:
-        path = instance.url
+    elif (sender == Item):
+        if instance.url:
+            path = instance.url
     else:
         return
     mime_type = get_mime_type(path)