Tighten dummy payment validation
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user