1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-27 13:34:28 +00:00

only show ryg members in the list

This commit is contained in:
Steffo 2020-08-30 00:57:09 +02:00
parent aa84b3a077
commit ff6f411e6a

View file

@ -11,8 +11,10 @@ class ApiUserRygListStar(rca.ApiStar):
@rca.magic @rca.magic
async def get(self, data: rca.ApiData) -> ru.JSON: async def get(self, data: rca.ApiData) -> ru.JSON:
"""Get Royalpack information about all user.""" """Get Royalpack information about all users."""
users: typing.List[rbt.User] = await ru.asyncify(data.session.query(self.alchemy.get(rbt.User)).all) users: typing.List[rbt.User] = await ru.asyncify(
data.session.query(self.alchemy.get(rbt.User)).all
)
return [{ return [{
**user.json(), **user.json(),
"bio": user.bio.json() if user.bio is not None else None, "bio": user.bio.json() if user.bio is not None else None,
@ -21,4 +23,4 @@ class ApiUserRygListStar(rca.ApiStar):
"leagueoflegends": [leagueoflegends.json() for leagueoflegends in user.leagueoflegends], "leagueoflegends": [leagueoflegends.json() for leagueoflegends in user.leagueoflegends],
"osu": [osu.json() for osu in user.osu], "osu": [osu.json() for osu in user.osu],
"trivia": user.trivia_score.json() if user.trivia_score is not None else None "trivia": user.trivia_score.json() if user.trivia_score is not None else None
} for user in users] } for user in users if "member" in user.roles]