Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Explicitly grab individual columns from group object
Browse files Browse the repository at this point in the history
  • Loading branch information
lukebarnard1 committed Apr 6, 2018
1 parent 7945435 commit db2fd80
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions synapse/groups/groups_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,13 +404,15 @@ def get_group_profile(self, group_id, requester_user_id):

yield self.check_group_is_ours(group_id, requester_user_id)

group_description = yield self.store.get_group(group_id)

if group_description:
join_policy = group_description['join_policy']
del group_description['join_policy']
group = yield self.store.get_group(group_id)

group_description['is_openly_joinable'] = join_policy == "open"
if group:
cols = [
"name", "short_description", "long_description",
"avatar_url", "is_public",
]
group_description = { key: group[key] for key in cols }
group_description["is_openly_joinable"] = group['join_policy'] == "open"

defer.returnValue(group_description)
else:
Expand Down

0 comments on commit db2fd80

Please sign in to comment.