Add the ability to choose the database path at startup. Add more tests. Add bandit
This commit is contained in:
parent
8c7226964a
commit
6bc5b66d3f
16 changed files with 297 additions and 97 deletions
|
|
@ -433,7 +433,7 @@ class DBManager:
|
|||
"""
|
||||
if not name:
|
||||
return "#CCCCCC"
|
||||
h = int(hashlib.sha1(name.encode("utf-8")).hexdigest()[:8], 16)
|
||||
h = int(hashlib.sha1(name.encode("utf-8")).hexdigest()[:8], 16) # nosec
|
||||
return _TAG_COLORS[h % len(_TAG_COLORS)]
|
||||
|
||||
# -------- Tags: per-page -------------------------------------------
|
||||
|
|
@ -514,7 +514,7 @@ class DBManager:
|
|||
SELECT id, name
|
||||
FROM tags
|
||||
WHERE name IN ({placeholders});
|
||||
""",
|
||||
""", # nosec
|
||||
tuple(final_tag_names),
|
||||
).fetchall()
|
||||
ids_by_name = {r["name"]: r["id"] for r in rows}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue