Blueprint view function name should not contain dots

This commit is contained in:
Caratpine 2017-08-19 11:41:03 +08:00 committed by David Lord
parent 0a1090890f
commit 2f57a0b917
No known key found for this signature in database
GPG key ID: 7A1C87E3F5BC42A8
3 changed files with 13 additions and 0 deletions

View file

@ -198,6 +198,8 @@ class Blueprint(_PackageBoundObject):
"""
if endpoint:
assert '.' not in endpoint, "Blueprint endpoints should not contain dots"
if view_func:
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))