fix(blueprints): @middleware IndexError (#139)

This commit is contained in:
Pahaz Blinov 2016-11-06 21:08:55 +05:00 committed by Eli Uriegas
parent ce8742c605
commit 1b65b2e0c6

View File

@ -109,8 +109,9 @@ class Blueprint:
# Detect which way this was called, @middleware or @middleware('AT') # Detect which way this was called, @middleware or @middleware('AT')
if len(args) == 1 and len(kwargs) == 0 and callable(args[0]): if len(args) == 1 and len(kwargs) == 0 and callable(args[0]):
middleware = args[0]
args = [] args = []
return register_middleware(args[0]) return register_middleware(middleware)
else: else:
return register_middleware return register_middleware