diff options
author | Kegan Dougal <kegan@matrix.org> | 2015-03-16 10:09:15 +0000 |
---|---|---|
committer | Kegan Dougal <kegan@matrix.org> | 2015-03-16 10:09:15 +0000 |
commit | f9232c7917322de392921336b4bab5d85c213c4e (patch) | |
tree | ab55547f1c895da508e6ac37c8056fef5b3b754e /synapse/rest | |
parent | Fix remaining scheduler bugs. Add more informative logging. (diff) | |
parent | add ToC and fix typoe (diff) | |
download | synapse-f9232c7917322de392921336b4bab5d85c213c4e.tar.xz |
Merge branch 'develop' into application-services-txn-reliability
Conflicts: synapse/storage/appservice.py
Diffstat (limited to 'synapse/rest')
-rw-r--r-- | synapse/rest/appservice/v1/register.py | 5 | ||||
-rw-r--r-- | synapse/rest/client/v1/push_rule.py | 5 |
2 files changed, 7 insertions, 3 deletions
diff --git a/synapse/rest/appservice/v1/register.py b/synapse/rest/appservice/v1/register.py index a4f6159773..ea24d88f79 100644 --- a/synapse/rest/appservice/v1/register.py +++ b/synapse/rest/appservice/v1/register.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Copyright 2015 OpenMarket Ltd # -# Licensed under the Apache License, Version 2.0 (the "License"); +# Licensensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # @@ -89,7 +89,8 @@ def _parse_json(request): if type(content) != dict: raise SynapseError(400, "Content must be a JSON object.") return content - except ValueError: + except ValueError as e: + logger.warn(e) raise SynapseError(400, "Content not JSON.") diff --git a/synapse/rest/client/v1/push_rule.py b/synapse/rest/client/v1/push_rule.py index fef0eb6572..d4e7ab2202 100644 --- a/synapse/rest/client/v1/push_rule.py +++ b/synapse/rest/client/v1/push_rule.py @@ -156,9 +156,12 @@ class PushRuleRestServlet(ClientV1RestServlet): template_rule = _rule_to_template(r) if template_rule: - template_rule['enabled'] = True if r['rule_id'] in enabled_map: template_rule['enabled'] = enabled_map[r['rule_id']] + elif 'enabled' in r: + template_rule['enabled'] = r['enabled'] + else: + template_rule['enabled'] = True rulearray.append(template_rule) path = request.postpath[1:] |