Invalidate cache for equipments on transaction update

This commit is contained in:
Keannu Bernasol 2024-01-07 11:00:06 +08:00
parent 4c11f54c08
commit 628e280102

View file

@ -43,5 +43,7 @@ class Transaction(models.Model):
return f"Transaction #{self.id} under {self.teacher} by {self.borrower}"
def save(self, *args, **kwargs):
cache.delete('available_equipment_instances')
cache.delete('equipment_instances')
cache.delete('non_finalized_transactions')
return super().save(*args, **kwargs)