user
This commit is contained in:
parent
d75f94ffcb
commit
5de40bdfdd
2 changed files with 2 additions and 2 deletions
|
@ -435,7 +435,7 @@ class File(models.Model):
|
|||
if k not in keys:
|
||||
del data[k]
|
||||
can_see_media = False
|
||||
if not user.is_anonymous():
|
||||
if user and not user.is_anonymous():
|
||||
can_see_media = user.profile.capability('canSeeMedia') or \
|
||||
user.is_staff or \
|
||||
self.item.user == user or \
|
||||
|
|
|
@ -479,7 +479,7 @@ def editMedia(request, data):
|
|||
update = True
|
||||
if update:
|
||||
f.save()
|
||||
response['data']['files'].append(f.json())
|
||||
response['data']['files'].append(f.json(user=request.user))
|
||||
else:
|
||||
response['data']['files'].append({'id': info['id'], 'error': 'permission denied'})
|
||||
if ignore:
|
||||
|
|
Loading…
Reference in a new issue