No longer raising a missing parameter when value is null
When passing a null value as parameter (ex.: 0, None or False), Sanic said "Error: Required parameter `param` was not passed to url_for" Example: ``` @app.route("/<idx>") def route(rq, idx): pass ``` ``` url_for("route", idx=0) ``` No longer raises: `Error: Required parameter `idx` was not passed to url_for`
This commit is contained in:
parent
72d56a89a2
commit
285ad9bdc1
|
@ -495,7 +495,7 @@ class Sanic:
|
||||||
specific_pattern = '^{}$'.format(pattern)
|
specific_pattern = '^{}$'.format(pattern)
|
||||||
supplied_param = None
|
supplied_param = None
|
||||||
|
|
||||||
if kwargs.get(name):
|
if name in kwargs:
|
||||||
supplied_param = kwargs.get(name)
|
supplied_param = kwargs.get(name)
|
||||||
del kwargs[name]
|
del kwargs[name]
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user