From d2b0c18001674db70c73b2083b1015a6991681b5 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Tue, 11 Jan 2011 17:25:43 +0530 Subject: [PATCH] is_anonymous --- pandora/itemlist/managers.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pandora/itemlist/managers.py b/pandora/itemlist/managers.py index 280d94247..7ba22d0bd 100644 --- a/pandora/itemlist/managers.py +++ b/pandora/itemlist/managers.py @@ -134,5 +134,8 @@ class ListManager(Manager): if conditions: qs = qs.filter(conditions) - qs = qs.filter(Q(status='public') | Q(status='featured') | Q(user=user)) + if user.is_anonymous: + qs = qs.filter(Q(status='public') | Q(status='featured')) + else: + qs = qs.filter(Q(status='public') | Q(status='featured') | Q(user=user)) return qs