diff options
author | Johannes Schönberger <hannes@hannes-mb.local> | 2010-04-11 16:56:33 +0200 |
---|---|---|
committer | Marcel Hellkamp <marc@gsites.de> | 2010-04-12 16:36:28 +0200 |
commit | 93ade0d5365f0244348289081129e7703f2f45f5 (patch) | |
tree | a6317f5844bf68c7744e91bea347b1ad85dad868 | |
parent | 7572e0effa8f024f54072ba74a56bea462199cff (diff) | |
download | bottle-auth.tar.gz |
improvement to auth_required decoratorauth
-rwxr-xr-x | bottle.py | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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 |