fix: check for payments app before importing gateway controller

This commit is contained in:
Jannat Patel
2024-11-29 16:41:00 +05:30
parent d1b613c0bb
commit 727f7b032c

View File

@@ -1,12 +1,15 @@
import frappe
from payments.utils import get_payment_gateway_controller
def get_payment_gateway():
return frappe.db.get_single_value("LMS Settings", "payment_gateway")
def get_controller(payment_gateway):
if "payments" in frappe.get_installed_apps():
from payments.utils import get_payment_gateway_controller
return get_payment_gateway_controller(payment_gateway)