Commit c8332480 authored by Elizabeth Myers's avatar Elizabeth Myers 💬
Browse files

listgroups: Fix destination on reply

parent 644032d0
......@@ -28,14 +28,21 @@ class ListGroups(Command):
if target[0] == '@':
stmt = (select(StorageGroup).
join(StorageGroupMember,
StorageGroupMember.group_id == StorageGroup.id).
where(StorageUser.username == client.username)
StorageGroupMember.group_id == StorageGroup.id).
where(StorageUser.username == client.username).
distinct()
)
else:
stmt = (select(StorageGroup))
result = await session.execute(stmt)
reply = Frame.create(f'@{client.username}', frame.dst,
if target[0] == '@':
dst = f'@{client.username}'
else:
dst = f'${conf.server_name}'
reply = Frame.create(f'@{client.username}', dst,
'listgroups', frame.related,
{'groups': [i.StorageGroup.name for i in result]})
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment