summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederick Yin <fkfd@fkfd.me>2021-10-29 14:52:22 +0800
committerFrederick Yin <fkfd@fkfd.me>2021-10-29 14:52:22 +0800
commit0f11b95cf154fb93d3e4c943027e594cde845da1 (patch)
tree0675c3119566de2e93492f9f7e2e72435cb07991
parent063f3b19289f353ec57f904f700fc5567a4584ba (diff)
Change entry key names in AdminLog
Because the module that calls it is no longer database, but routine.
-rw-r--r--jimbrella/admin_log.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/jimbrella/admin_log.py b/jimbrella/admin_log.py
index 2d130c7..1b3ce1e 100644
--- a/jimbrella/admin_log.py
+++ b/jimbrella/admin_log.py
@@ -60,11 +60,11 @@ class AdminLog:
info = {}
if event in ("TAKEAWAY", "GIVEBACK", "OVERDUE"):
info = {
- "serial": int(row[2]),
- "tenant_name": row[3],
- "tenant_id": row[4],
- "tenant_phone": row[5],
- "tenant_email": row[6],
+ "key": int(row[2]),
+ "name": row[3],
+ "id": row[4],
+ "phone": row[5],
+ "email": row[6],
}
elif event == "ADMIN_MODIFY_DB":
info = {
@@ -133,18 +133,18 @@ class AdminLog:
info = []
if event in ("TAKEAWAY", "GIVEBACK", "OVERDUE"):
info = [
- entry[col]
+ entry[col] if col in entry else ""
for col in [
- "serial",
- "tenant_name",
- "tenant_id",
- "tenant_phone",
- "tenant_email",
+ "key",
+ "name",
+ "id",
+ "phone",
+ "email",
]
]
elif event == "ADMIN_MODIFY_DB":
info = [
- entry[col]
+ entry[col] if col in entry else ""
for col in [
"admin_name",
"serial",