Skip to content
Snippets Groups Projects
Commit 1eb3795c authored by Dariusz Kędzierski's avatar Dariusz Kędzierski
Browse files

Fix for missing category in undelete

parent d7c85464
No related branches found
No related tags found
5 merge requests!456Release candidate v1 24,!230Setup monitoring with pghero,!135Enable postgres monitoring on CI server,!16Dk issue 3 concurrent block query rebase,!15Dk issue 3 concurrent block query
......@@ -347,14 +347,11 @@ class Posts:
"""Re-allocates an existing record flagged as deleted."""
print("Undelete")
# add category to category table
if 'category' in op:
sql = """
INSERT INTO hive_category_data (category)
VALUES (:category)
ON CONFLICT (category) DO NOTHING"""
DB.query(sql, category=op['category'])
sql = """UPDATE hive_posts SET is_valid = :is_valid,
sql = """INSERT INTO hive_category_data (category)
VALUES (:category)
ON CONFLICT (category) DO NOTHING;
UPDATE hive_posts SET is_valid = :is_valid,
is_muted = :is_muted, is_deleted = '0', is_pinned = '0',
parent_id = :parent_id, category_id = (SELECT id FROM hive_category_data WHERE category = :category),
community_id = :community_id, depth = :depth
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment