This commit is contained in:
j 2017-07-27 21:55:48 +02:00
parent d75f94ffcb
commit 5de40bdfdd
2 changed files with 2 additions and 2 deletions

View file

@ -435,7 +435,7 @@ class File(models.Model):
if k not in keys: if k not in keys:
del data[k] del data[k]
can_see_media = False can_see_media = False
if not user.is_anonymous(): if user and not user.is_anonymous():
can_see_media = user.profile.capability('canSeeMedia') or \ can_see_media = user.profile.capability('canSeeMedia') or \
user.is_staff or \ user.is_staff or \
self.item.user == user or \ self.item.user == user or \

View file

@ -479,7 +479,7 @@ def editMedia(request, data):
update = True update = True
if update: if update:
f.save() f.save()
response['data']['files'].append(f.json()) response['data']['files'].append(f.json(user=request.user))
else: else:
response['data']['files'].append({'id': info['id'], 'error': 'permission denied'}) response['data']['files'].append({'id': info['id'], 'error': 'permission denied'})
if ignore: if ignore: