Fix logic bug in param check

This commit is contained in:
Joseph Schorr 2015-07-20 17:04:06 -04:00
parent 679044574a
commit 5f2729f41f

View file

@ -94,7 +94,7 @@ def param_required(param_name, allow_body=False):
@wraps(wrapped)
def decorated(*args, **kwargs):
if param_name not in request.args:
if not allow_body and param_name not in request.values:
if not allow_body or param_name not in request.values:
abort(make_response('Required param: %s' % param_name, 400))
return wrapped(*args, **kwargs)
return decorated