Skip to content

Commit

Permalink
update to proposed getUserGroups API
Browse files Browse the repository at this point in the history
  • Loading branch information
obriencj committed Jul 11, 2024
1 parent 97791ee commit 050f52e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion kojismokydingo/cli/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def cli_userinfo(
if groups:
print("Groups:")
for group in sorted(groups, key=lambda m: m.get("name")):
print(f" {group['name']} [{group['group_id']}]")
print(f" {group['name']} [{group['id']}]")

perms = userinfo.get("permissions", None)
if perms:
Expand Down
2 changes: 1 addition & 1 deletion kojismokydingo/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ class UserGroup(TypedDict):
:since: 2.2.0
"""

group_id: int
id: int
""" the ID of the group """

name: str
Expand Down
2 changes: 1 addition & 1 deletion kojismokydingo/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def get_user_groups(

else:
hist = session.queryHistory(tables=["user_groups"], active=True)
return [{"name": g["group.name"], "group_id": g["group_id"]}
return [{"name": g["group.name"], "id": g["group_id"]}
for g in hist["user_groups"]
if g["user_id"] == uid]

Expand Down

0 comments on commit 050f52e

Please sign in to comment.