fix(payments): ensure payments app installed on the site in payment_app_import_guard (#57342)

This commit is contained in:
Diptanil Saha
2026-07-22 02:51:40 +05:30
committed by GitHub
parent 6d31af3a52
commit 8cb96496ec

View File

@@ -78,7 +78,11 @@ def payment_app_import_guard():
msg = _("payments app is not installed. Please install it from {0} or {1}").format(
marketplace_link, github_link
)
if "payments" not in frappe.get_installed_apps():
frappe.throw(msg, title=_("Missing Payments App"), exc=frappe.AppNotInstalledError)
try:
yield
except ImportError:
frappe.throw(msg, title=_("Missing Payments App"))
frappe.throw(msg, title=_("Missing Payments App"), exc=frappe.AppNotInstalledError)