Merge pull request #54202 from frappe/mergify/bp/version-14/pr-54192

fix: added exception handling on service level agreement apply hook (#50096) (backport #54192)
This commit is contained in:
diptanilsaha
2026-04-10 17:22:07 +05:30
committed by GitHub

View File

@@ -449,10 +449,16 @@ def get_documents_with_active_service_level_agreement():
def set_documents_with_active_service_level_agreement(): def set_documents_with_active_service_level_agreement():
active = [ try:
sla.document_type for sla in frappe.get_all("Service Level Agreement", fields=["document_type"]) active = frozenset(
] sla.document_type for sla in frappe.get_all("Service Level Agreement", fields=["document_type"])
frappe.cache().hset("service_level_agreement", "active", active) )
frappe.cache().hset("service_level_agreement", "active", active)
except (frappe.DoesNotExistError, frappe.db.TableMissingError):
# This happens during install / uninstall when wildcard hook for SLA intercepts some doc action.
# In both cases, the error can be safely ignored.
active = frozenset()
return active return active