From: Fredrik Tolf Date: Fri, 3 Nov 2023 23:29:26 +0000 (+0100) Subject: Fix keyword-parameter handling bug in formparams. X-Git-Url: http://git.dolda2000.com/gitweb/?a=commitdiff_plain;h=319f64489df808309a7f50cdffce3ab894eb39b3;p=wrw.git Fix keyword-parameter handling bug in formparams. --- diff --git a/wrw/util.py b/wrw/util.py index dcf745a..6fa4155 100644 --- a/wrw/util.py +++ b/wrw/util.py @@ -25,6 +25,8 @@ def formparams(callable): if par.name in data: args[par.name] = data[par.name] for par in sig.parameters.values(): + if par.kind is inspect.Parameter.VAR_KEYWORD: + continue if par.default is inspect.Parameter.empty and par.name not in args: raise resp.httperror(400, "Missing parameter", ("The query parameter `", resp.h.code(par.name), "' is required but not supplied.")) return callable(**args)