]> git.parisson.com Git - mezzo.git/commitdiff
Fix no object.images
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Tue, 27 Sep 2016 14:08:19 +0000 (16:08 +0200)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Tue, 27 Sep 2016 14:08:19 +0000 (16:08 +0200)
app/organization/core/templatetags/organization_tags.py

index e89fd63ce1f6ea707a4b60928414aa9d33b578b4..68d6609a64291d4ea86a40facc5017d0726dc9ea 100644 (file)
@@ -93,15 +93,17 @@ def get_mezzanine_menu_name(menu_id):
 
 @register.filter
 def get_type(objects, type):
-    if isinstance(objects, list):
-        objs = []
-        for object in objects:
-            if obj.type == type:
-                objs.append(obj)
-    else:
-        objs = objects.filter(type=type)
-    if objs:
-        return objs
+    print(objects)
+    if objects:
+        if isinstance(objects, list):
+            objs = []
+            for object in objects:
+                if obj.type == type:
+                    objs.append(obj)
+        else:
+            objs = objects.filter(type=type)
+        if objs:
+            return objs
     return None
 
 @register.filter