Dolda2000 GitWeb
/
wrw.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7756066
)
Fixed formparams bug when defaults are missing.
author
Fredrik Tolf
<fredrik@dolda2000.com>
Wed, 26 Jun 2013 03:38:40 +0000
(
05:38
+0200)
committer
Fredrik Tolf
<fredrik@dolda2000.com>
Wed, 26 Jun 2013 03:38:40 +0000
(
05:38
+0200)
wrw/util.py
patch
|
blob
|
blame
|
history
diff --git
a/wrw/util.py
b/wrw/util.py
index
759c295
..
aea3037
100644
(file)
--- a/
wrw/util.py
+++ b/
wrw/util.py
@@
-17,7
+17,7
@@
def formparams(callable):
for arg in list(args):
if arg not in spec.args:
del args[arg]
- for i in xrange(len(spec.args) -
len(spec.defaults
)):
+ for i in xrange(len(spec.args) -
(len(spec.defaults) if spec.defaults else 0
)):
if spec.args[i] not in args:
raise resp.httperror(400, "Missing parameter", ("The query parameter `", resp.h.code(spec.args[i]), "' is required but not supplied."))
return callable(**args)