Add admin issue deletion workflow
This commit is contained in:
@@ -3519,6 +3519,23 @@ def update_portal_item(
|
||||
return updated
|
||||
|
||||
|
||||
def delete_portal_item(item_id: int) -> bool:
|
||||
with _connect() as conn:
|
||||
conn.execute(
|
||||
"UPDATE portal_items SET related_item_id = NULL WHERE related_item_id = ?",
|
||||
(item_id,),
|
||||
)
|
||||
conn.execute("DELETE FROM portal_comments WHERE item_id = ?", (item_id,))
|
||||
conn.execute("DELETE FROM portal_item_activity WHERE item_id = ?", (item_id,))
|
||||
deleted = conn.execute(
|
||||
"DELETE FROM portal_items WHERE id = ?",
|
||||
(item_id,),
|
||||
).rowcount
|
||||
if deleted:
|
||||
logger.info("portal item deleted id=%s", item_id)
|
||||
return bool(deleted)
|
||||
|
||||
|
||||
def add_portal_comment(
|
||||
item_id: int,
|
||||
*,
|
||||
|
||||
Reference in New Issue
Block a user