From 628e280102173f962a0db88726f8d29dbba9c262 Mon Sep 17 00:00:00 2001 From: Keannu Bernasol Date: Sun, 7 Jan 2024 11:00:06 +0800 Subject: [PATCH] Invalidate cache for equipments on transaction update --- equipment_tracker/transactions/models.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/equipment_tracker/transactions/models.py b/equipment_tracker/transactions/models.py index dd968de..65f735c 100644 --- a/equipment_tracker/transactions/models.py +++ b/equipment_tracker/transactions/models.py @@ -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)