mirror of
https://github.com/zulip/zulip.git
synced 2026-07-15 21:03:26 +08:00
@has_request_variables: don't apply the converter to default values
(imported from commit 44fecac26268c4c1b7f69b4d5013cfbff2010744)
This commit is contained in:
parent
472480a4b6
commit
8a0bef6c42
@ -157,14 +157,16 @@ def has_request_variables(view_func):
|
||||
@wraps(view_func)
|
||||
def _wrapped_view_func(request, *args, **kwargs):
|
||||
for param in post_params:
|
||||
default_assigned = False
|
||||
try:
|
||||
val = request.POST[param.post_var_name]
|
||||
except KeyError:
|
||||
if param.default is POST.NotSpecified:
|
||||
return json_error("Missing '%s' argument" % (param.post_var_name,))
|
||||
val = param.default
|
||||
default_assigned = True
|
||||
|
||||
if param.converter is not None:
|
||||
if param.converter is not None and not default_assigned:
|
||||
try:
|
||||
val = param.converter(val)
|
||||
except:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user