Fix registering partials as view functions

This commit is contained in:
ThiefMaster 2018-04-27 13:38:35 +02:00
parent 8ceff653c5
commit 6663bf1f7d
3 changed files with 5 additions and 1 deletions

View file

@ -201,7 +201,7 @@ class Blueprint(_PackageBoundObject):
"""
if endpoint:
assert '.' not in endpoint, "Blueprint endpoints should not contain dots"
if view_func:
if view_func and hasattr(view_func, '__name__'):
assert '.' not in view_func.__name__, "Blueprint view function name should not contain dots"
self.record(lambda s:
s.add_url_rule(rule, endpoint, view_func, **options))