|
|
|
@ -29,11 +29,15 @@ class Bill(models.Model): |
|
|
|
|
|
|
|
|
|
|
|
def freeze_course(self, user): |
|
|
|
def freeze_course(self, user): |
|
|
|
if self.invoice_set.exclude(status='F').exists(): |
|
|
|
if self.invoice_set.exclude(status='F').exists(): |
|
|
|
|
|
|
|
log = False |
|
|
|
try: |
|
|
|
try: |
|
|
|
p = Progress.objects.get(user=user, course_token=self.course_token) |
|
|
|
p = Progress.objects.get(user=user, course_token=self.course_token) |
|
|
|
p.freeze = True |
|
|
|
p.freeze = True |
|
|
|
p.save() |
|
|
|
p.save() |
|
|
|
except Progress.DoesNotExist: |
|
|
|
except Progress.DoesNotExist: |
|
|
|
|
|
|
|
log = True |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if log: |
|
|
|
logger_business_rules.info('Отказ от платежей прошёл успешно', exc_info=True, extra={ |
|
|
|
logger_business_rules.info('Отказ от платежей прошёл успешно', exc_info=True, extra={ |
|
|
|
'description': 'The privileges were not taken away, as they were not granted', |
|
|
|
'description': 'The privileges were not taken away, as they were not granted', |
|
|
|
'user': user, |
|
|
|
'user': user, |
|
|
|
|