partially fixed issue 832, auth.requires raises 401 on ajax, thanks Paolo Valleri

This commit is contained in:
mdipierro
2012-12-12 22:07:20 -06:00
parent 380c78b758
commit 37acdc0cc6
2 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -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
View File
@@ -2899,7 +2899,9 @@ class Auth(object):
user = user or self.user
if requires_login:
if not user:
if not otherwise is None:
if current.request.ajax:
raise HTTP(401)
elif not otherwise is None:
if callable(otherwise):
return otherwise()
redirect(otherwise)