mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-26 08:05:53 +00:00
fix: handle empty loyalty point details
(cherry picked from commit 1231ca17c9)
This commit is contained in:
@@ -43,10 +43,10 @@ def get_loyalty_details(
|
|||||||
|
|
||||||
loyalty_point_details = query.run(as_dict=True)
|
loyalty_point_details = query.run(as_dict=True)
|
||||||
|
|
||||||
return {
|
if loyalty_point_details:
|
||||||
"loyalty_points": flt(loyalty_point_details[0].loyalty_points),
|
return loyalty_point_details[0]
|
||||||
"total_spent": flt(loyalty_point_details[0].total_spent),
|
else:
|
||||||
}
|
return {"loyalty_points": 0, "total_spent": 0}
|
||||||
|
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
|
|||||||
Reference in New Issue
Block a user