]> git.mxchange.org Git - fba.git/commitdiff
Continued: master
authorRoland Häder <roland@mxchange.org>
Sun, 16 Mar 2025 15:47:33 +0000 (16:47 +0100)
committerRoland Häder <roland@mxchange.org>
Sun, 16 Mar 2025 15:47:33 +0000 (16:47 +0100)
- sqlite3.Row doesn't allow assigning values, so we need copy it to a dict()
  and then it can be modified

daemon.py

index da2b1c4c0837184571ce643be06ea0e87969692e..e5bb81f9f4c10553fb1591d2f6394de60e2d968a 100755 (executable)
--- a/daemon.py
+++ b/daemon.py
@@ -229,13 +229,13 @@ LIMIT ?", [
 
     result = {}
     for row in list(rows):
-        if row["reason"] not in [None, ""]:
-            row["reason"] = row["reason"].replace(",", " ").replace("  ", " ")
+        entry = dict(row)
+        entry["reason"] = entry["reason"].replace(",", " ").replace("  ", " ") if entry["reason"] not in [None, ""] else None
 
-        if row["block_level"] in result:
-            result[row["block_level"]].append(row)
+        if entry["block_level"] in result:
+            result[entry["block_level"]].append(entry)
         else:
-            result[row["block_level"]] = [row]
+            result[entry["block_level"]] = [entry]
 
     return result