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

Revert "[JES] Add a limit on the get_discussion call to only return at most 2000..."

This reverts commit abf88ff6
parent abf88ff6
No related branches found
No related tags found
3 merge requests!456Release candidate v1 24,!230Setup monitoring with pghero,!135Enable postgres monitoring on CI server
......@@ -340,8 +340,7 @@ async def get_relationship_between_accounts(context, account1, account2, observe
'follows': False,
'ignores': False,
'is_blacklisted': False,
'follows_blacklists': False,
'follows_muted': False
'follows_blacklists': False
}
for row in sql_result:
......@@ -355,36 +354,6 @@ async def get_relationship_between_accounts(context, account1, account2, observe
result['is_blacklisted'] = True
if row['follow_blacklists']:
result['follows_blacklists'] = True
if row['follow_muted']:
result['follows_muted'] = True
return result
@return_error_info
async def get_follow_list(context, observer, follow_type = 'blacklisted', starting_account = '', limit = 20):
db = context['db']
valid_account(observer)
valid_account(starting_account, allow_empty=True)
valid_limit(limit, 100)
valid_types = ['blacklisted', 'follow_blacklist', 'muted', 'follow_muted']
assert follow_type in valid_types, 'invalid follow_type'
results = []
blacklists_for_user = await Mutes.get_blacklists_for_observer(observer, context)
for account in blacklists_for_user.keys():
sources = blacklists_for_user[account]
if follow_type == 'blacklisted':
if 'my_blacklist' in sources:
results.append(account)
elif follow_type == 'follow_blacklist':
if 'my_followed_blacklists' in sources:
results.append(account)
elif follow_type == 'muted':
if 'my_muted' in sources:
results.append(account)
elif follow_type == 'follow_muted':
if 'my_followed_mutes' in sources:
results.append(account)
return results
......@@ -45,7 +45,6 @@ async def get_discussion(context, author, permlink, observer=None):
INNER JOIN hive_post_data hpd ON hpd.id = hive_posts.id
INNER JOIN hive_category_data hcd ON hcd.id = hp.category_id
WHERE NOT hive_posts.is_deleted AND NOT hive_posts.is_muted
LIMIT 2000
"""
blacklists_for_user = None
......
......@@ -19,15 +19,6 @@ WITH blacklisted_users AS (
(SELECT following FROM hive_follows WHERE follower =
(SELECT id FROM hive_accounts WHERE name = :observer )
AND follow_blacklists) AND blacklisted
UNION ALL
SELECT following, 'my_muted' AS source FROM hive_follows WHERE follower =
(SELECT id FROM hive_accounts WHERE name = :observer)
AND state = 2
UNION ALL
SELECT following, 'my_followed_mutes' AS source FROm hive_follows WHERE follower IN
(SELECT following FROM hive_follows WHERE follower =
(SELECT id FROM hive_accounts WHERE name = :observer)
AND follow_muted) AND state = 2
)
SELECT following, source FROM blacklisted_users
"""
......@@ -105,7 +96,6 @@ class Mutes:
if account_name not in blacklisted_users:
blacklisted_users[account_name] = []
blacklisted_users[account_name].append(row['source'])
print('blacklist for user', blacklisted_users)
return blacklisted_users
@classmethod
......
......@@ -82,7 +82,6 @@ async def call(context, api, method, params):
"params":["database_api","get_state",["trending"]]}
```"""
# pylint: disable=too-many-return-statements, too-many-branches, no-else-return
print("api is: ", api)
assert api == 'condenser_api', "`call` requires condenser_api"
# Follows
......
......@@ -138,7 +138,6 @@ def build_methods():
bridge_api.get_profile,
bridge_api.get_trending_topics,
bridge_api.get_relationship_between_accounts,
bridge_api.get_follow_list,
hive_api_notify.post_notifications,
hive_api_notify.account_notifications,
hive_api_notify.unread_notifications,
......
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