partially fixed issue 832, auth.requires raises 401 on ajax, thanks Paolo Valleri
This commit is contained in:
@@ -1 +1 @@
|
|||||||
Version 2.3.0 (2012-12-12 22:02:50) rc1
|
Version 2.3.0 (2012-12-12 22:06:35) rc1
|
||||||
|
|||||||
+3
-1
@@ -2899,7 +2899,9 @@ class Auth(object):
|
|||||||
user = user or self.user
|
user = user or self.user
|
||||||
if requires_login:
|
if requires_login:
|
||||||
if not user:
|
if not user:
|
||||||
if not otherwise is None:
|
if current.request.ajax:
|
||||||
|
raise HTTP(401)
|
||||||
|
elif not otherwise is None:
|
||||||
if callable(otherwise):
|
if callable(otherwise):
|
||||||
return otherwise()
|
return otherwise()
|
||||||
redirect(otherwise)
|
redirect(otherwise)
|
||||||
|
|||||||
Reference in New Issue
Block a user