You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
462 B
12 lines
462 B
from finance.tasks import send_to_yandex
|
|
from django.db.models.signals import pre_save
|
|
from django.dispatch import receiver
|
|
|
|
from finance.models import Invoice
|
|
|
|
|
|
@receiver(pre_save, sender=Invoice)
|
|
def delete_dependencies(instance, **kwargs):
|
|
"""Отправка сообщения после сохранения платежа"""
|
|
if instance.yandex_pay and instance.method == 'Y' and instance.status == 'P':
|
|
send_to_yandex(instance.yandex_pay)
|
|
|