login is 401

This commit is contained in:
j 2010-02-08 20:35:08 +05:30
parent 3d2e5f5bd6
commit 5c99a88970

View file

@ -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)