mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-20 02:34:41 +00:00
fix: task should explicitly call commit and rollback if error
This commit is contained in:
@@ -424,8 +424,15 @@ def process(data):
|
||||
Checks a `Subscription` and updates it status as necessary
|
||||
"""
|
||||
if data:
|
||||
subscription = frappe.get_doc('Subscriptions', data['name'])
|
||||
subscription.process()
|
||||
try:
|
||||
subscription = frappe.get_doc('Subscriptions', data['name'])
|
||||
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()
|
||||
|
||||
Reference in New Issue
Block a user