mirror of
https://github.com/lemeow125/Borrowing-TrackerBackend.git
synced 2024-11-17 06:19:26 +08:00
Invalidate cache for equipments on transaction update
This commit is contained in:
parent
4c11f54c08
commit
628e280102
1 changed files with 2 additions and 0 deletions
|
@ -43,5 +43,7 @@ class Transaction(models.Model):
|
||||||
return f"Transaction #{self.id} under {self.teacher} by {self.borrower}"
|
return f"Transaction #{self.id} under {self.teacher} by {self.borrower}"
|
||||||
|
|
||||||
def save(self, *args, **kwargs):
|
def save(self, *args, **kwargs):
|
||||||
|
cache.delete('available_equipment_instances')
|
||||||
|
cache.delete('equipment_instances')
|
||||||
cache.delete('non_finalized_transactions')
|
cache.delete('non_finalized_transactions')
|
||||||
return super().save(*args, **kwargs)
|
return super().save(*args, **kwargs)
|
||||||
|
|
Loading…
Reference in a new issue