Enhanced the `deepl_translate` management command with improved placeholder handling, error messages, and support for missing translations. Added `human_readable_id` and `is_business` attributes to the `Order` model, updating associated admin configurations to reflect these changes.
21 lines
644 B
Python
21 lines
644 B
Python
from django.db.models.signals import post_save
|
|
from django.dispatch import receiver
|
|
|
|
from payments.models import Balance, Transaction
|
|
from vibes_auth.models import User
|
|
|
|
|
|
@receiver(post_save, sender=User)
|
|
def create_balance_on_user_creation_signal(instance, created, **kwargs):
|
|
if created:
|
|
Balance.objects.create(user=instance)
|
|
|
|
|
|
@receiver(post_save, sender=Transaction)
|
|
def process_transaction_changes(instance, created, **kwargs):
|
|
if created:
|
|
try:
|
|
gateway = object()
|
|
gateway.process_transaction(instance)
|
|
except Exception: # noqa:
|
|
instance.process = {"status": "NOGATEWAY"}
|