From 285ad9bdc123cdc83480441d86ae9a3e083b17e7 Mon Sep 17 00:00:00 2001 From: NyanKiyoshi Date: Fri, 26 Jan 2018 21:13:43 +0100 Subject: [PATCH] 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("/") def route(rq, idx): pass ``` ``` url_for("route", idx=0) ``` No longer raises: `Error: Required parameter `idx` was not passed to url_for` --- sanic/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sanic/app.py b/sanic/app.py index a81bb4a8..6e8377f5 100644 --- a/sanic/app.py +++ b/sanic/app.py @@ -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: