From b6e66481f85a2ef8a00732a2b0e6435522edfe56 Mon Sep 17 00:00:00 2001 From: Frederick Yin Date: Thu, 28 Oct 2021 22:59:45 +0800 Subject: Fix admin logging bug in Database Database.give_back keeps log before umbrella data are wiped --- jimbrella/database.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jimbrella/database.py b/jimbrella/database.py index 410985e..b8522ab 100644 --- a/jimbrella/database.py +++ b/jimbrella/database.py @@ -219,12 +219,12 @@ class Database(CsvTable): raise UmbrellaNotFoundError(serial) elif umb["status"] not in ("lent", "overdue"): raise UmbrellaStatusError + self.admin_log.log("GIVEBACK", umb) umb["status"] = "available" for key in ["tenant_name", "tenant_id", "tenant_phone", "tenant_email"]: umb[key] = "" umb["lent_at"] = None self._update(umb) - self.admin_log.log("GIVEBACK", umb) def mark_overdue(self, serial) -> None: """When an umbrella is overdue, change its status to "overdue".""" -- cgit v1.2.3