From ff6f411e6a89d564fda0e90bdadd47d88256a8bb Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sun, 30 Aug 2020 00:57:09 +0200 Subject: [PATCH] only show ryg members in the list --- royalpack/stars/api_user_ryg_list.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/royalpack/stars/api_user_ryg_list.py b/royalpack/stars/api_user_ryg_list.py index 9cd53231..942974f1 100644 --- a/royalpack/stars/api_user_ryg_list.py +++ b/royalpack/stars/api_user_ryg_list.py @@ -11,8 +11,10 @@ class ApiUserRygListStar(rca.ApiStar): @rca.magic async def get(self, data: rca.ApiData) -> ru.JSON: - """Get Royalpack information about all user.""" - users: typing.List[rbt.User] = await ru.asyncify(data.session.query(self.alchemy.get(rbt.User)).all) + """Get Royalpack information about all users.""" + users: typing.List[rbt.User] = await ru.asyncify( + data.session.query(self.alchemy.get(rbt.User)).all + ) return [{ **user.json(), "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], "osu": [osu.json() for osu in user.osu], "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]