diff options
author | Mark Haines <mark.haines@matrix.org> | 2016-01-13 13:08:59 +0000 |
---|---|---|
committer | Mark Haines <mark.haines@matrix.org> | 2016-01-13 13:32:59 +0000 |
commit | 9c1f853d58440d1f924fa55bc242b248c410dd7c (patch) | |
tree | 0d4ed6019a7208e1e7c35015f5a33b7d0af89af8 /synapse/rest/client/v1/push_rule.py | |
parent | Merge pull request #482 from matrix-org/markjh/table_name (diff) | |
download | synapse-9c1f853d58440d1f924fa55bc242b248c410dd7c.tar.xz |
Rename 'user_name' to 'user_id' in push to make it consistent with the rest of the code
Diffstat (limited to 'synapse/rest/client/v1/push_rule.py')
-rw-r--r-- | synapse/rest/client/v1/push_rule.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/synapse/rest/client/v1/push_rule.py b/synapse/rest/client/v1/push_rule.py index c0a21c0c12..df53824d2d 100644 --- a/synapse/rest/client/v1/push_rule.py +++ b/synapse/rest/client/v1/push_rule.py @@ -73,7 +73,7 @@ class PushRuleRestServlet(ClientV1RestServlet): try: yield self.hs.get_datastore().add_push_rule( - user_name=requester.user.to_string(), + user_id=requester.user.to_string(), rule_id=_namespaced_rule_id_from_spec(spec), priority_class=priority_class, conditions=conditions, @@ -206,7 +206,7 @@ class PushRuleRestServlet(ClientV1RestServlet): def on_OPTIONS(self, _): return 200, {} - def set_rule_attr(self, user_name, spec, val): + def set_rule_attr(self, user_id, spec, val): if spec['attr'] == 'enabled': if isinstance(val, dict) and "enabled" in val: val = val["enabled"] @@ -217,15 +217,15 @@ class PushRuleRestServlet(ClientV1RestServlet): raise SynapseError(400, "Value for 'enabled' must be boolean") namespaced_rule_id = _namespaced_rule_id_from_spec(spec) self.hs.get_datastore().set_push_rule_enabled( - user_name, namespaced_rule_id, val + user_id, namespaced_rule_id, val ) else: raise UnrecognizedRequestError() - def get_rule_attr(self, user_name, namespaced_rule_id, attr): + def get_rule_attr(self, user_id, namespaced_rule_id, attr): if attr == 'enabled': return self.hs.get_datastore().get_push_rule_enabled_by_user_rule_id( - user_name, namespaced_rule_id + user_id, namespaced_rule_id ) else: raise UnrecognizedRequestError() |