Respect disabled payments in launch validation
This commit is contained in:
@@ -44,12 +44,23 @@ def get_checkout_apps() -> list[str]:
|
||||
return [app for app in settings.INSTALLED_APPS if "checkout" in app.lower()]
|
||||
|
||||
|
||||
def idea_marketplace_payments_enabled() -> bool:
|
||||
return bool(getattr(settings, "IDEA_MARKETPLACE_PAYMENTS_ENABLED", False))
|
||||
|
||||
|
||||
def validate_payment_provider_config() -> None:
|
||||
installed_apps = list(settings.INSTALLED_APPS)
|
||||
payment_apps = get_declared_payment_apps(installed_apps)
|
||||
checkout_apps = get_checkout_apps()
|
||||
config_plugins = get_declared_plugins()
|
||||
|
||||
if not idea_marketplace_payments_enabled():
|
||||
if any(_is_dummy_payment_app(app) for app in config_plugins):
|
||||
raise CommandError(
|
||||
"Dummy payment app is declared in ocyan.json. Remove it even when payments are disabled."
|
||||
)
|
||||
return
|
||||
|
||||
if not payment_apps:
|
||||
raise CommandError("No payment app declared for this project.")
|
||||
if not checkout_apps:
|
||||
|
||||
Reference in New Issue
Block a user