fix: Combine request args and form data
- To accept argument via both way in a single request
This commit is contained in:
parent
fbf926d1f6
commit
fba15b3874
1 changed files with 3 additions and 1 deletions
|
|
@ -185,7 +185,9 @@ def make_form_dict(request):
|
|||
if 'application/json' in (request.content_type or '') and request_data:
|
||||
args = json.loads(request_data)
|
||||
else:
|
||||
args = request.form or request.args
|
||||
args = {}
|
||||
args.update(request.args or {})
|
||||
args.update(request.form or {})
|
||||
|
||||
if not isinstance(args, dict):
|
||||
frappe.throw(_("Invalid request arguments"))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue