summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederick Yin <fkfd@fkfd.me>2022-02-02 11:15:53 +0800
committerFrederick Yin <fkfd@fkfd.me>2022-02-02 11:15:53 +0800
commitc8caa0ca774c89484d64b5e7ee308e379f834cea (patch)
treef4cb3d87adc3039ff327f27f6e1ddd9dece922f9
parent66264fe5730943576b847077dadf5e4531d4beb1 (diff)
Reword admin logs
-rw-r--r--jimbrella/admin_log.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/jimbrella/admin_log.py b/jimbrella/admin_log.py
index 622abec..bb57787 100644
--- a/jimbrella/admin_log.py
+++ b/jimbrella/admin_log.py
@@ -38,6 +38,7 @@ class AdminLog:
def __init__(self, path: str):
self.path = path
self.lockfile = Lockfile(self.path)
+ self.lockfile.unlock()
def _read(self) -> list:
"""Deserialize admin log."""
@@ -71,7 +72,7 @@ class AdminLog:
elif event == "ADMIN_MODIFY_DB":
info = {
"admin_name": row[2],
- "serial": int(row[3]),
+ "id": int(row[3]),
"column": row[4],
"past_value": row[5],
"new_value": row[6],
@@ -107,12 +108,12 @@ class AdminLog:
)
elif event == "ADMIN_MODIFY_DB":
if not entry["past_value"]:
- description = "{admin_name} set {column} of umbrella #{serial} to {new_value}."
+ description = "{admin_name} set {column} of umbrella #{id} to {new_value}."
elif not entry["new_value"]:
- description = "{admin_name} cleared {column} of umbrella #{serial} (was {past_value})."
+ description = "{admin_name} cleared {column} of umbrella #{id} (was {past_value})."
else:
description = (
- "{admin_name} changed {column} of umbrella #{serial} "
+ "{admin_name} changed {column} of umbrella #{id} "
"from {past_value} to {new_value}."
)
@@ -159,7 +160,7 @@ class AdminLog:
entry[col] if col in entry else ""
for col in [
"admin_name",
- "serial",
+ "id",
"column",
"past_value",
"new_value",