From 9b21e867b2f4056b28b7564bcabb04c9c4543a25 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Tue, 14 Feb 2012 21:44:04 +0530 Subject: [PATCH] item.find --- pandora/item/managers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora/item/managers.py b/pandora/item/managers.py index 483b4dd3..74bb554b 100644 --- a/pandora/item/managers.py +++ b/pandora/item/managers.py @@ -269,7 +269,7 @@ class ItemManager(Manager): qs = qs.filter(id__in=lqs[0].items.all()) return qs - def find(self, data, user): + def find(self, data, user=None): ''' query: { conditions: [ @@ -301,7 +301,7 @@ class ItemManager(Manager): qs = qs.distinct() #anonymous can only see public items - if user.is_anonymous(): + if not user or user.is_anonymous(): allowed_level = settings.CONFIG['capabilities']['canSeeItem']['guest'] qs = qs.filter(level__lte=allowed_level) #users can see public items, there own items and items of there groups