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:
@@ -495,7 +495,7 @@ class Sanic:
|
||||
specific_pattern = '^{}$'.format(pattern)
|
||||
supplied_param = None
|
||||
|
||||
if kwargs.get(name):
|
||||
if name in kwargs:
|
||||
supplied_param = kwargs.get(name)
|
||||
del kwargs[name]
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user