diff options
author | Mark Haines <mjark@negativecurvature.net> | 2016-03-09 11:26:26 +0000 |
---|---|---|
committer | review.rocks <nobody@review.rocks> | 2016-03-09 11:26:26 +0000 |
commit | b7dbe5147a85bea8f14b78a27ff499fe5a0d444a (patch) | |
tree | b8a25b359abf412a692a6f391d142c5cfa9a98bb /synapse/rest/client/v2_alpha/register.py | |
parent | Ensure integer is an integer (diff) | |
download | synapse-b7dbe5147a85bea8f14b78a27ff499fe5a0d444a.tar.xz |
Add a parse_json_object function
to deduplicate all the copy+pasted _parse_json functions. Also document the parse_.* functions.
Diffstat (limited to 'synapse/rest/client/v2_alpha/register.py')
-rw-r--r-- | synapse/rest/client/v2_alpha/register.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/synapse/rest/client/v2_alpha/register.py b/synapse/rest/client/v2_alpha/register.py index ec5c21fa1f..b090e66bcf 100644 --- a/synapse/rest/client/v2_alpha/register.py +++ b/synapse/rest/client/v2_alpha/register.py @@ -17,9 +17,9 @@ from twisted.internet import defer from synapse.api.constants import LoginType from synapse.api.errors import SynapseError, Codes, UnrecognizedRequestError -from synapse.http.servlet import RestServlet +from synapse.http.servlet import RestServlet, parse_json_object_from_request -from ._base import client_v2_patterns, parse_json_dict_from_request +from ._base import client_v2_patterns import logging import hmac @@ -73,7 +73,7 @@ class RegisterRestServlet(RestServlet): ret = yield self.onEmailTokenRequest(request) defer.returnValue(ret) - body = parse_json_dict_from_request(request) + body = parse_json_object_from_request(request) # we do basic sanity checks here because the auth layer will store these # in sessions. Pull out the username/password provided to us. @@ -236,7 +236,7 @@ class RegisterRestServlet(RestServlet): @defer.inlineCallbacks def onEmailTokenRequest(self, request): - body = parse_json_dict_from_request(request) + body = parse_json_object_from_request(request) required = ['id_server', 'client_secret', 'email', 'send_attempt'] absent = [] |