fix(API): allow creation from request data

Counteract f63ad574e5
Fix #8230
This commit is contained in:
Raffael Meyer 2019-08-22 00:14:38 +02:00 committed by GitHub
parent 3d2e570553
commit a71a92341e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -113,7 +113,10 @@ def handle():
doctype, **frappe.local.form_dict)})
if frappe.local.request.method=="POST":
data = json.loads(frappe.local.form_dict.data)
if frappe.local.form_dict.data is None:
data = json.loads(request.get_data())
else:
data = json.loads(frappe.local.form_dict.data)
data.update({
"doctype": doctype
})