Skip to content
Snippets Groups Projects

random order of communities admins

Merged Marcin requested to merge mi_random_order_of_communities_admins into develop
1 file
+ 2
2
Compare changes
  • Side-by-side
  • Inline
@@ -311,7 +311,7 @@ async def _append_admins(db, communities):
@@ -311,7 +311,7 @@ async def _append_admins(db, communities):
ids = communities.keys()
ids = communities.keys()
sql = """SELECT community_id, ha.name FROM hive_roles hr
sql = """SELECT community_id, ha.name FROM hive_roles hr
JOIN hive_accounts ha ON hr.account_id = ha.id
JOIN hive_accounts ha ON hr.account_id = ha.id
WHERE role_id = 6 AND community_id IN :ids"""
WHERE role_id = 6 AND community_id IN :ids ORDER BY ha.name"""
for row in await db.query_all(sql, ids=tuple(ids)):
for row in await db.query_all(sql, ids=tuple(ids)):
_id = row[0]
_id = row[0]
if 'admins' not in communities[_id]:
if 'admins' not in communities[_id]:
@@ -368,5 +368,5 @@ async def _top_community_posts(db, community, limit=50):
@@ -368,5 +368,5 @@ async def _top_community_posts(db, community, limit=50):
WHERE hcd.category = :community AND hp.counter_deleted = 0 AND NOT hp.is_paidout
WHERE hcd.category = :community AND hp.counter_deleted = 0 AND NOT hp.is_paidout
AND post_id IN (SELECT id FROM hive_posts WHERE is_muted = '0')
AND post_id IN (SELECT id FROM hive_posts WHERE is_muted = '0')
ORDER BY ( hp.payout + hp.pending_payout ) DESC LIMIT :limit"""
ORDER BY ( hp.payout + hp.pending_payout ) DESC LIMIT :limit"""
return await db.query_all(sql, community=community, limit=limit)
return await db.query_all(sql, community=community, limit=limit)
Loading