Add suggestion for resolving error caused by endpoint overlapping

This commit is contained in:
Hepheir-ZenBook 2021-08-30 11:50:40 +09:00 committed by David Lord
parent f8c881b887
commit 4968030440
No known key found for this signature in database
GPG key ID: 7A1C87E3F5BC42A8

View file

@ -1093,7 +1093,9 @@ class Flask(Scaffold):
if old_func is not None and old_func != view_func:
raise AssertionError(
"View function mapping is overwriting an existing"
f" endpoint function: {endpoint}"
f" endpoint function: {endpoint}.\n"
"Use 'route(... , endpoint=\"other_name\")' to"
" specify a different name."
)
self.view_functions[endpoint] = view_func