Fix bug where we /always/ created a new state group

This commit is contained in:
Erik Johnston 2014-11-11 14:16:41 +00:00
parent ed8b7d400c
commit 5ff0bfb81d
3 changed files with 41 additions and 30 deletions

View file

@ -16,11 +16,6 @@
from ._base import SQLBaseStore
from twisted.internet import defer
from collections import namedtuple
StateGroup = namedtuple("StateGroup", ("group", "state"))
class StateStore(SQLBaseStore):
@ -37,7 +32,7 @@ class StateStore(SQLBaseStore):
if group:
groups.add(group)
res = []
res = {}
for group in groups:
state_ids = yield self._simple_select_onecol(
table="state_groups_state",
@ -53,7 +48,7 @@ class StateStore(SQLBaseStore):
if s:
state.append(s)
res.append(StateGroup(group, state))
res[group] = state
defer.returnValue(res)