perf: don't cleanup plaintext fallback

This commit is contained in:
Ankush Menat
2025-05-26 15:21:56 +05:30
parent 41d56c8e3a
commit 7b811a93b4

View File

@@ -226,7 +226,10 @@ class Item(Document):
def validate_description(self):
"""Clean HTML description if set"""
if cint(frappe.db.get_single_value("Stock Settings", "clean_description_html")):
if (
cint(frappe.db.get_single_value("Stock Settings", "clean_description_html"))
and self.description != self.item_name # perf: Avoid cleaning up a fallback
):
self.description = clean_html(self.description)
def validate_customer_provided_part(self):