Skip to content
Snippets Groups Projects
Commit 2fd88873 authored by Bartek Wrona's avatar Bartek Wrona
Browse files

branch 'deployed_fixes_2_develop' rebased onto develop

parents 7f0fb4d6 a18289b5
Branches deployed_fixes_2_develop
No related tags found
2 merge requests!456Release candidate v1 24,!292Changes done directly in deployed_20200928_pure branch delivered to develop.
......@@ -20,7 +20,7 @@ CREATE OR REPLACE VIEW public.hive_posts_base_view
FROM hive_posts hp
;
DROP VIEW IF EXISTS public.hive_posts_pp_view;
DROP VIEW IF EXISTS public.hive_posts_pp_view CASCADE;
CREATE OR REPLACE VIEW public.hive_posts_pp_view
AS
......
......@@ -3,6 +3,7 @@
import logging
from time import perf_counter as perf
from urllib.request import urlopen, Request
from hive.db.adapter import Db
log = logging.getLogger(__name__)
......@@ -64,7 +65,13 @@ class Mutes:
def load(self):
"""Reload all accounts from irredeemables endpoint and global lists."""
# TODO: Refactor/remove this method
self.all_accounts.clear()
sql = "select id, name from hive_accounts"
db = Db.instance()
sql_result = db.query_all(sql)
for row in sql_result:
self.all_accounts[row['id']] = row['name']
self.fetched = perf()
@classmethod
def all(cls):
......
......@@ -137,7 +137,7 @@ async def get_state(context, path: str):
assert not part[2], "unexpected discussion path part[2] %s" % path
sort = valid_sort(part[0])
tag = valid_tag(part[1].lower(), allow_empty=True)
pids = await get_posts_by_given_sort(db, sort, '', '', 20, tag)
pids = await get_posts_by_given_sort(context, sort, '', '', 20, tag)
state['content'] = _keyed_posts(await load_posts(db, pids))
state['discussion_idx'] = {tag: {sort: list(state['content'].keys())}}
state['tag_idx'] = {'trending': await get_top_trending_tags_summary(context)}
......
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