From 93ade0d5365f0244348289081129e7703f2f45f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Sun, 11 Apr 2010 16:56:33 +0200 Subject: improvement to auth_required decorator --- bottle.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bottle.py') 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 -- cgit v1.2.1