Merge branch 'yandex_rebiling' into 'dev'

finance email

See merge request !314
master
Andrey 8 years ago
commit 19a460853b
  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)
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.is_open:
try:

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

Loading…
Cancel
Save