fix: task should explicitly call commit
and rollback if error
This commit is contained in:
parent
36c18c913e
commit
ca5cf35a99
@ -424,8 +424,15 @@ def process(data):
|
|||||||
Checks a `Subscription` and updates it status as necessary
|
Checks a `Subscription` and updates it status as necessary
|
||||||
"""
|
"""
|
||||||
if data:
|
if data:
|
||||||
|
try:
|
||||||
subscription = frappe.get_doc('Subscriptions', data['name'])
|
subscription = frappe.get_doc('Subscriptions', data['name'])
|
||||||
subscription.process()
|
subscription.process()
|
||||||
|
frappe.db.commit()
|
||||||
|
except frappe.ValidationError:
|
||||||
|
frappe.db.rollback()
|
||||||
|
frappe.db.begin()
|
||||||
|
frappe.log_error(frappe.get_traceback())
|
||||||
|
frappe.db.commit()
|
||||||
|
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user