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