fix order of operations derp and also use `.get` to default to {}

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2018-01-10 15:11:35 +00:00
parent 8c9d5b4873
commit 5f07f5694c
1 changed files with 3 additions and 2 deletions

View File

@ -383,9 +383,10 @@ class GroupsLocalHandler(object):
defer.returnValue({"groups": result})
else:
result = yield self.transport_client.bulk_get_publicised_groups(
bulk_result = yield self.transport_client.bulk_get_publicised_groups(
get_domain_from_id(user_id), [user_id],
)["users"][user_id]
)
result = bulk_result.get("users", {}).get(user_id)
# TODO: Verify attestations
defer.returnValue({"groups": result})