Merge remote-tracking branch 'origin/master'

remotes/origin/hotfix/LIL-661
nikita 7 years ago
commit 2a6bd7faf9
  1. 10
      apps/payment/models.py

@ -193,8 +193,9 @@ class CoursePayment(Payment):
verbose_name_plural = 'Платежи за курсы'
def save(self, *args, **kwargs):
amount_data = Payment.calc_amount(course_payment=self)
self.amount = amount_data.get('amount')
if self.status is None:
amount_data = Payment.calc_amount(course_payment=self)
self.amount = amount_data.get('amount')
super().save(*args, **kwargs)
author_balance = getattr(self, 'authorbalance', None)
if not author_balance:
@ -226,8 +227,9 @@ class SchoolPayment(Payment):
return days
def save(self, *args, **kwargs):
amount_data = Payment.calc_amount(school_payment=self)
self.amount = amount_data.get('amount')
if self.status is None:
amount_data = Payment.calc_amount(school_payment=self)
self.amount = amount_data.get('amount')
super().save(*args, **kwargs)
@property

Loading…
Cancel
Save