parent
cfe1238b67
commit
468317b182
4 changed files with 23 additions and 8 deletions
@ -0,0 +1,12 @@ |
||||
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) |
||||
Loading…
Reference in new issue