Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
hivemind
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
hivemind
Commits
4bac995b
Commit
4bac995b
authored
5 years ago
by
roadscape
Browse files
Options
Downloads
Patches
Plain Diff
limit subs resp, add created date
parent
afa13056
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
hive/server/hive_api/community.py
+6
-3
6 additions, 3 deletions
hive/server/hive_api/community.py
with
6 additions
and
3 deletions
hive/server/hive_api/community.py
+
6
−
3
View file @
4bac995b
...
...
@@ -117,18 +117,21 @@ async def list_all_subscriptions(context, account):
@return_error_info
async
def
list_subscribers
(
context
,
community
):
"""
Lists subscribers of `community`.
"""
#limit = valid_limit(limit, 100)
db
=
context
[
'
db
'
]
cid
=
await
get_community_id
(
db
,
community
)
sql
=
"""
SELECT ha.name, hr.role_id, hr.title
sql
=
"""
SELECT ha.name, hr.role_id, hr.title
, hs.created_at
FROM hive_subscriptions hs
LEFT JOIN hive_roles hr ON hs.account_id = hr.account_id
AND hs.community_id = hr.community_id
JOIN hive_accounts ha ON hs.account_id = ha.id
WHERE hs.community_id = :cid
ORDER BY hs.created_at DESC
"""
ORDER BY hs.created_at DESC
LIMIT 250
"""
rows
=
await
db
.
query_all
(
sql
,
cid
=
cid
)
return
[(
r
[
'
name
'
],
ROLES
[
r
[
'
role_id
'
]
or
0
],
r
[
'
title
'
])
for
r
in
rows
]
return
[(
r
[
'
name
'
],
ROLES
[
r
[
'
role_id
'
]
or
0
],
r
[
'
title
'
],
str
(
r
[
'
created_at
'
]))
for
r
in
rows
]
@return_error_info
async
def
list_communities
(
context
,
last
=
''
,
limit
=
100
,
query
=
None
,
observer
=
None
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment