typo: permissino permission in 403 errors
This commit is contained in:
parent
86a1d96484
commit
51c3df9660
3 changed files with 5 additions and 5 deletions
|
@ -157,7 +157,7 @@ def upload(request, data=None):
|
||||||
item.tasks.load_subtitles.delay(f.item.public_id)
|
item.tasks.load_subtitles.delay(f.item.public_id)
|
||||||
response = json_response(text='file saved')
|
response = json_response(text='file saved')
|
||||||
else:
|
else:
|
||||||
response = json_response(status=403, text='permissino denied')
|
response = json_response(status=403, text='permission denied')
|
||||||
return render_to_json_response(response)
|
return render_to_json_response(response)
|
||||||
actions.register(upload, cache=False)
|
actions.register(upload, cache=False)
|
||||||
|
|
||||||
|
@ -505,7 +505,7 @@ def removeMedia(request, data):
|
||||||
i.save()
|
i.save()
|
||||||
add_changelog(request, data, data['ids'])
|
add_changelog(request, data, data['ids'])
|
||||||
else:
|
else:
|
||||||
response = json_response(status=403, text='permissino denied')
|
response = json_response(status=403, text='permission denied')
|
||||||
return render_to_json_response(response)
|
return render_to_json_response(response)
|
||||||
actions.register(removeMedia, cache=False)
|
actions.register(removeMedia, cache=False)
|
||||||
|
|
||||||
|
|
|
@ -505,7 +505,7 @@ def add(request, data):
|
||||||
see: edit, find, get, lookup, remove, upload
|
see: edit, find, get, lookup, remove, upload
|
||||||
'''
|
'''
|
||||||
if not request.user.get_profile().capability('canAddItems'):
|
if not request.user.get_profile().capability('canAddItems'):
|
||||||
response = json_response(status=403, text='permissino denied')
|
response = json_response(status=403, text='permission denied')
|
||||||
else:
|
else:
|
||||||
data['title'] = data.get('title', 'Untitled')
|
data['title'] = data.get('title', 'Untitled')
|
||||||
i = models.Item()
|
i = models.Item()
|
||||||
|
@ -619,7 +619,7 @@ def setPosterFrame(request, data):
|
||||||
response = json_response()
|
response = json_response()
|
||||||
add_changelog(request, data)
|
add_changelog(request, data)
|
||||||
else:
|
else:
|
||||||
response = json_response(status=403, text='permissino denied')
|
response = json_response(status=403, text='permission denied')
|
||||||
return render_to_json_response(response)
|
return render_to_json_response(response)
|
||||||
actions.register(setPosterFrame, cache=False)
|
actions.register(setPosterFrame, cache=False)
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,6 @@ def capability_required_json(capability):
|
||||||
if request.user.is_authenticated() and \
|
if request.user.is_authenticated() and \
|
||||||
request.user.get_profile().capability(capability):
|
request.user.get_profile().capability(capability):
|
||||||
return function(request, *args, **kwargs)
|
return function(request, *args, **kwargs)
|
||||||
return render_to_json_response(json_response(status=403, text='permissino denied'))
|
return render_to_json_response(json_response(status=403, text='permission denied'))
|
||||||
return wraps(function)(_wrapped_view)
|
return wraps(function)(_wrapped_view)
|
||||||
return capability_required
|
return capability_required
|
||||||
|
|
Loading…
Reference in a new issue