summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schönberger <hannes@hannes-mb.local>2010-04-11 16:56:33 +0200
committerMarcel Hellkamp <marc@gsites.de>2010-04-12 16:36:28 +0200
commit93ade0d5365f0244348289081129e7703f2f45f5 (patch)
treea6317f5844bf68c7744e91bea347b1ad85dad868
parent7572e0effa8f024f54072ba74a56bea462199cff (diff)
downloadbottle-auth.tar.gz
improvement to auth_required decoratorauth
-rwxr-xr-xbottle.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/bottle.py b/bottle.py
index 5ffa28d..045b462 100755
--- a/bottle.py
+++ b/bottle.py
@@ -1122,9 +1122,9 @@ def auth_required(check, realm='bottle-authentication'):
except (TypeError, AttributeError):
auth = False
else:
- try:
+ if callable(check):
auth = check(user, password)
- except TypeError:
+ else:
auth = False
if user in check and check[user] == password:
auth = True