login is 401
This commit is contained in:
parent
3d2e5f5bd6
commit
5c99a88970
1 changed files with 1 additions and 3 deletions
|
@ -13,8 +13,6 @@ def login_required_json(function=None):
|
||||||
def _wrapped_view(request, *args, **kwargs):
|
def _wrapped_view(request, *args, **kwargs):
|
||||||
if request.user.is_authenticated():
|
if request.user.is_authenticated():
|
||||||
return function(request, *args, **kwargs)
|
return function(request, *args, **kwargs)
|
||||||
response = render_to_json_response({'status': {'code': 403, 'text': 'login required'}})
|
return render_to_json_response({'status': {'code': 401, 'text': 'login required'}})
|
||||||
response.status_code = 403
|
|
||||||
return response
|
|
||||||
return wraps(function)(_wrapped_view)
|
return wraps(function)(_wrapped_view)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue