Piwigo: return collections list only to logged in users.
authorMats Sjöberg <mats@sjoberg.fi>
Tue, 21 May 2013 19:42:41 +0000 (22:42 +0300)
committerMats Sjöberg <mats@sjoberg.fi>
Tue, 21 May 2013 19:42:41 +0000 (22:42 +0300)
mediagoblin/plugins/piwigo/views.py

index c348fd54be21a2800e27f5aa8a2b4ad87a1c5664..250bf758458b0117223141d470300fa5e2440862 100644 (file)
@@ -87,12 +87,13 @@ def pwg_categories_getList(request):
                 'uppercats': "-29711",
                 'name': "All my images"}]
 
-    for c in collections:
-        catlist.append({'id': c.id,
-                        'uppercats': str(c.id),
-                        'name': c.title,
-                        'comment': c.description
-                        })
+    if request.user:
+        for c in collections:
+            catlist.append({'id': c.id,
+                            'uppercats': str(c.id),
+                            'name': c.title,
+                            'comment': c.description
+                            })
 
     return {
           'categories': PwgNamedArray(