summaryrefslogtreecommitdiff
path: root/jimbrella
diff options
context:
space:
mode:
authorFrederick Yin <fkfd@fkfd.me>2021-10-28 22:59:45 +0800
committerFrederick Yin <fkfd@fkfd.me>2021-10-28 22:59:45 +0800
commitb6e66481f85a2ef8a00732a2b0e6435522edfe56 (patch)
treeadf99a1a62fdb6743efd5d5976dc8dfd742b311a /jimbrella
parent16448c30fb4d01d3ceb8209ea8b640b2601e897d (diff)
Fix admin logging bug in Database
Database.give_back keeps log before umbrella data are wiped
Diffstat (limited to 'jimbrella')
-rw-r--r--jimbrella/database.py2
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"."""