remove Refilling.is_validated

This commit is contained in:
imperosol
2025-11-19 20:05:35 +01:00
parent 78fe4e52ca
commit 56c2c2b70e
6 changed files with 20 additions and 18 deletions

View File

@@ -755,7 +755,6 @@ class Refilling(models.Model):
bank = models.CharField(
_("bank"), max_length=255, choices=settings.SITH_COUNTER_BANK, default="OTHER"
)
is_validated = models.BooleanField(_("is validated"), default=False)
objects = RefillingQuerySet.as_manager()
@@ -772,10 +771,9 @@ class Refilling(models.Model):
if not self.date:
self.date = timezone.now()
self.full_clean()
if not self.is_validated:
if self._state.adding:
self.customer.amount += self.amount
self.customer.save()
self.is_validated = True
if self.customer.user.preferences.notify_on_refill:
Notification(
user=self.customer.user,