diff --git a/hive/db/sql_scripts/hive_posts_base_view.sql b/hive/db/sql_scripts/hive_posts_base_view.sql index 024291a52806a269427264ee1c3b854d83159594..746aeeb0bf17cedceba4593717b32a5793d702fb 100644 --- a/hive/db/sql_scripts/hive_posts_base_view.sql +++ b/hive/db/sql_scripts/hive_posts_base_view.sql @@ -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 diff --git a/hive/server/common/mutes.py b/hive/server/common/mutes.py index c99cb71ce3c1c654ad0cea7f510f3d48a603bd44..019d09a81a1ae1f6173c1a87bf2867874aa3e785 100644 --- a/hive/server/common/mutes.py +++ b/hive/server/common/mutes.py @@ -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): diff --git a/hive/server/condenser_api/get_state.py b/hive/server/condenser_api/get_state.py index b3a3fa95f3e5bcad1c4f305314296d351a48ae42..c4454d50d65410a16c3c214b4fe7dd046f7de15c 100644 --- a/hive/server/condenser_api/get_state.py +++ b/hive/server/condenser_api/get_state.py @@ -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)} diff --git a/tests/tests_api b/tests/tests_api index b76dcb51fe38d952078d44bfe811ddded9de642a..bcaaeea430be8e4dc1ddd0b6a05375623ea14aa4 160000 --- a/tests/tests_api +++ b/tests/tests_api @@ -1 +1 @@ -Subproject commit b76dcb51fe38d952078d44bfe811ddded9de642a +Subproject commit bcaaeea430be8e4dc1ddd0b6a05375623ea14aa4