Skip to content
Snippets Groups Projects
Commit d21bc4ae authored by Jason Salyers's avatar Jason Salyers
Browse files

[JES] Check that blackilsts exist before trying to reference them

parent 56329e2c
No related branches found
No related tags found
2 merge requests!456Release candidate v1 24,!370Jsalyers muting at sql level
......@@ -52,11 +52,11 @@ BEGIN
FROM hive_posts hp1
JOIN hive_accounts_view ha ON hp1.author_id = ha.id
WHERE hp1.counter_deleted = 0 AND hp1.depth = 0 AND NOT ha.is_grayed AND ( __post_id = 0 OR hp1.id < __post_id )
AND (CASE WHEN _observer <> '' THEN hp.aouthor NOT IN (SELECT muted FROM muted_accounts_view WHERE observer = _observer) ELSE True END)
ORDER BY hp1.id DESC
LIMIT _limit
) as created
JOIN hive_posts_view hp ON hp.id = created.id
WHERE (CASE WHEN _observer <> '' THEN hp.author NOT IN (SELECT muted FROM muted_accounts_view WHERE observer = _observer) ELSE True END)
ORDER BY created.id DESC
LIMIT _limit;
END
......
......@@ -19,7 +19,7 @@ def append_statistics_to_post(post, row, is_pinned, blacklists_for_user=[], over
""" apply information such as blacklists and community names/roles to a given post """
post['blacklists'] = []
if row['author'] in blacklists_for_user:
if blacklists_for_user and row['author'] in blacklists_for_user:
blacklists = blacklists_for_user[row['author']]
for blacklist in blacklists:
post['blacklists'].append(blacklist)
......
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