revision logic revisited

This commit is contained in:
Danilo Reyes
2026-02-28 23:33:06 -06:00
parent 766eca4a2f
commit 9da87b68e9
3 changed files with 28 additions and 2 deletions

View File

@@ -170,6 +170,15 @@ def add_link(
""",
(user_name, url_original, url_norm, site),
)
if tombstone:
conn.execute(
"""
UPDATE links
SET requires_revision = 0
WHERE id = ?
""",
(cur.lastrowid,),
)
add_history(
conn,
user_name=user_name,
@@ -198,7 +207,7 @@ def set_enabled(
conn.execute(
"""
UPDATE links
SET enabled = 1, disabled_at = NULL, updated_at = CURRENT_TIMESTAMP
SET enabled = 1, disabled_at = NULL, requires_revision = 0, updated_at = CURRENT_TIMESTAMP
WHERE id = ?
""",
(row["id"],),
@@ -252,7 +261,7 @@ def set_banned(
conn.execute(
"""
UPDATE links
SET banned_at = NULL, banned_reason = NULL, updated_at = CURRENT_TIMESTAMP
SET banned_at = NULL, banned_reason = NULL, requires_revision = 0, updated_at = CURRENT_TIMESTAMP
WHERE id = ?
""",
(row["id"],),