diff options
author | Frederick Yin <fkfd@fkfd.me> | 2021-10-28 22:59:45 +0800 |
---|---|---|
committer | Frederick Yin <fkfd@fkfd.me> | 2021-10-28 22:59:45 +0800 |
commit | b6e66481f85a2ef8a00732a2b0e6435522edfe56 (patch) | |
tree | adf99a1a62fdb6743efd5d5976dc8dfd742b311a | |
parent | 16448c30fb4d01d3ceb8209ea8b640b2601e897d (diff) |
Fix admin logging bug in Database
Database.give_back keeps log before umbrella data are wiped
-rw-r--r-- | jimbrella/database.py | 2 |
1 files changed, 1 insertions, 1 deletions
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".""" |