only show admin totals to admins

This commit is contained in:
j 2014-05-06 19:01:34 +02:00
parent c649e0eee4
commit 1bcbd90b83

View file

@ -282,7 +282,11 @@ Positions
Sum('pixels'), Sum('pixels'),
Sum('size') 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: if 'duration' in totals:
response['data']['duration'] = r['duration__sum'] response['data']['duration'] = r['duration__sum']
if 'files' in totals: if 'files' in totals: