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

Co-authored-by: Diptanil Saha <diptanil@frappe.io>
This commit is contained in:
mergify[bot]
2026-07-21 23:12:53 +00:00
committed by GitHub
parent a0ac2a58dd
commit 2c8c076f6e

View File

@@ -47,7 +47,11 @@ def payment_app_import_guard():
msg = _("payments app is not installed. Please install it from {} or {}").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)