mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-26 00:14:50 +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
|
Checks a `Subscription` and updates it status as necessary
|
||||||
"""
|
"""
|
||||||
if data:
|
if data:
|
||||||
subscription = frappe.get_doc('Subscriptions', data['name'])
|
try:
|
||||||
subscription.process()
|
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()
|
@frappe.whitelist()
|
||||||
|
|||||||
Reference in New Issue
Block a user