Merge remote-tracking branch 'origin/master'

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

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

Loading…
Cancel
Save