only show admin totals to admins
This commit is contained in:
parent
c649e0eee4
commit
1bcbd90b83
1 changed files with 5 additions and 1 deletions
|
@ -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:
|
||||||
|
|
Loading…
Reference in a new issue