From 6020c112d53c310b2554b12774ab4c54c5d23e0e Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Fri, 7 Sep 2018 16:47:30 +0100 Subject: [PATCH] thinko --- synapse/storage/roommember.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/synapse/storage/roommember.py b/synapse/storage/roommember.py index a751ff723a..ef73ff874b 100644 --- a/synapse/storage/roommember.py +++ b/synapse/storage/roommember.py @@ -98,7 +98,8 @@ class RoomMemberWorkerStore(EventsWorkerStore): res = {} for r in txn: summary = res.setdefault(to_ascii(r[1]), {}) - summary['users'].append((to_ascii(r[0]), to_ascii(r[2]))) + users = summary.setdefault('users', []) + users.append((to_ascii(r[0]), to_ascii(r[2]))) sql = ( "SELECT count(*), m.membership FROM room_memberships as m" @@ -112,7 +113,7 @@ class RoomMemberWorkerStore(EventsWorkerStore): txn.execute(sql, (room_id,)) for r in txn: summary = res.setdefault(to_ascii(r[1]), {}) - summary['count'] = r[0] + summary.set('count', r[0]) return res