From 5c99a8897023e284d65d53b068cbbbb817d8fe27 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Mon, 8 Feb 2010 20:35:08 +0530 Subject: [PATCH] login is 401 --- oxdjango/decorators.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/oxdjango/decorators.py b/oxdjango/decorators.py index e616536..47bac6e 100644 --- a/oxdjango/decorators.py +++ b/oxdjango/decorators.py @@ -13,8 +13,6 @@ def login_required_json(function=None): def _wrapped_view(request, *args, **kwargs): if request.user.is_authenticated(): return function(request, *args, **kwargs) - response = render_to_json_response({'status': {'code': 403, 'text': 'login required'}}) - response.status_code = 403 - return response + return render_to_json_response({'status': {'code': 401, 'text': 'login required'}}) return wraps(function)(_wrapped_view)