Tighten dummy payment validation

This commit is contained in:
2026-04-09 01:06:49 +02:00
parent 4648b7b0b3
commit bbb88f9a2f
2 changed files with 17 additions and 2 deletions

View File

@@ -16,7 +16,10 @@ from mandelstudio.idea_marketplace import (
IDEA_PRODUCTS,
SHORT_DESCRIPTION_ATTRIBUTE_CODE,
)
from mandelstudio.launch_validation import validate_payment_provider_config
from mandelstudio.launch_validation import (
_is_dummy_payment_app,
validate_payment_provider_config,
)
class Command(BaseCommand):
@@ -34,6 +37,12 @@ class Command(BaseCommand):
validate_payment_provider_config()
installed_apps = list(settings.INSTALLED_APPS)
if any(_is_dummy_payment_app(app) for app in installed_apps):
raise CommandError(
"Dummy payment app detected in INSTALLED_APPS. Use a real provider plugin before production launch."
)
config_path = Path(__file__).resolve().parents[2] / "ocyan.json"
if config_path.exists():
with config_path.open("r", encoding="utf-8") as handle: