Merge pull request #807 from matrix-org/erikj/push_rules_cache

Ensure we always return boolean in push rules
pull/814/head
Erik Johnston 2016-06-01 18:07:48 +01:00
commit a04a2d043c
1 changed files with 2 additions and 1 deletions

View File

@ -106,7 +106,8 @@ class PushRuleStore(SQLBaseStore):
desc="bulk_get_push_rules_enabled", desc="bulk_get_push_rules_enabled",
) )
for row in rows: for row in rows:
results.setdefault(row['user_name'], {})[row['rule_id']] = row['enabled'] enabled = bool(row['enabled'])
results.setdefault(row['user_name'], {})[row['rule_id']] = enabled
defer.returnValue(results) defer.returnValue(results)
@defer.inlineCallbacks @defer.inlineCallbacks