finance email

remotes/origin/yandex_rebiling
Andrey 8 years ago
parent d898ab95ee
commit cf07fde91a
  1. 11
      finance/signals.py
  2. 3
      finance/views.py

@ -16,17 +16,6 @@ def invoice_signal(instance, **kwargs):
course = Course.objects.get(token=instance.bill.course_token) course = Course.objects.get(token=instance.bill.course_token)
if instance.yandex_pay and instance.method == 'Y' and instance.status == 'P':
msg = EmailMessage(
'Вам выставлен новый счёт',
"""%s для оплаты перейдите по ссылке
%s/api/v1/finance/payment/%s/""" % (instance.get_comment(), settings.DOMAIN, instance.yandex_pay.id),
to=[instance.yandex_pay.cps_email],
bcc=[instance.bill.opener.email],
reply_to=[instance.bill.opener.email],
)
msg.send()
if instance.status == 'F': if instance.status == 'F':
if instance.is_open: if instance.is_open:
try: try:

@ -127,7 +127,6 @@ class InvoiceDetailView(APIView):
is_open=is_open, is_open=is_open,
pay_count=pay_count, pay_count=pay_count,
) )
invoice.send_link()
else: else:
try: try:
invoice = Invoice.objects.get(id=invoice_id) invoice = Invoice.objects.get(id=invoice_id)
@ -173,6 +172,8 @@ class InvoiceDetailView(APIView):
) )
invoice.yandex_pay = yandex_pay invoice.yandex_pay = yandex_pay
invoice.send_link()
context = { context = {
'user_email': invoice.bill.user.email, 'user_email': invoice.bill.user.email,
'opener_full_name': invoice.bill.opener.get_full_name(), 'opener_full_name': invoice.bill.opener.get_full_name(),

Loading…
Cancel
Save