From 1bcbd90b833b9e874f6ff9fe63493a26a8981af3 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Tue, 6 May 2014 19:01:34 +0200 Subject: [PATCH] only show admin totals to admins --- pandora/item/views.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pandora/item/views.py b/pandora/item/views.py index 5cc91fdfe..ab39bfc70 100644 --- a/pandora/item/views.py +++ b/pandora/item/views.py @@ -282,7 +282,11 @@ Positions Sum('pixels'), Sum('size') ) - totals = [i['id'] for i in settings.CONFIG['totals']] + level = 'guest' if request.user.is_anonymous() else request.user.get_profile().get_level() + totals = [i['id'] + for i in settings.CONFIG['totals'] + if not i.get('admin', False) or level in ('admin', 'staff') + ] if 'duration' in totals: response['data']['duration'] = r['duration__sum'] if 'files' in totals: