Major refactor of commerce and Stripe integration
Refactored commerce models to support refunds, invoices, and improved carrier/payment logic. Added new serializers and viewsets for products, categories, images, discount codes, and refunds. Introduced Stripe client integration and removed legacy Stripe admin/model code. Updated Dockerfile for PDF generation dependencies. Removed obsolete migration files and updated configuration app initialization. Added invoice template and tasks for order cleanup.
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
from django.apps import AppConfig
|
||||
from django.db.utils import OperationalError, ProgrammingError
|
||||
from .models import ShopConfiguration
|
||||
|
||||
class ConfigurationConfig(AppConfig):
|
||||
default_auto_field = 'django.db.models.BigAutoField'
|
||||
@@ -13,9 +12,11 @@ class ConfigurationConfig(AppConfig):
|
||||
makemigrations/migrate don't fail when the table does not yet exist.
|
||||
"""
|
||||
try:
|
||||
ShopConfiguration.get_solo()
|
||||
from .models import ShopConfiguration # local import to avoid premature app registry access
|
||||
ShopConfiguration.get_solo() # creates if missing
|
||||
|
||||
except (OperationalError, ProgrammingError):
|
||||
ShopConfiguration.objects.create()
|
||||
# DB not ready (e.g., before initial migrate); ignore silently
|
||||
pass
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user