Refactored Stripe payment integration to use a dedicated Stripe model for session data, updating the PaymentSerializer accordingly. Renamed Order.Status to Order.OrderStatus for clarity. Updated configuration app to ensure SiteConfiguration singleton is created post-migration. Removed obsolete seed_app_config command from docker-compose. Adjusted frontend API generated files and moved orval config.
23 lines
604 B
Python
23 lines
604 B
Python
from django.apps import AppConfig
|
|
from django.db.models.signals import post_migrate
|
|
|
|
def create_site_config(sender, **kwargs):
|
|
"""
|
|
Ensure the SiteConfiguration singleton exists after migrations.
|
|
"""
|
|
from .models import SiteConfiguration
|
|
try:
|
|
SiteConfiguration.get_solo()
|
|
except Exception:
|
|
pass
|
|
|
|
class ConfigurationConfig(AppConfig):
|
|
default_auto_field = 'django.db.models.BigAutoField'
|
|
name = 'configuration'
|
|
|
|
def ready(self):
|
|
# Spustí create_site_config po dokončení migrací
|
|
post_migrate.connect(create_site_config, sender=self)
|
|
|
|
|