mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 22:14:55 -04:00
Refector out assert_params_in_request
and replace requestEmailToken where we meant requestMsisdnToken
This commit is contained in:
parent
88df6c0c9a
commit
2e27339add
3 changed files with 27 additions and 37 deletions
|
@ -192,6 +192,16 @@ def parse_json_object_from_request(request):
|
|||
return content
|
||||
|
||||
|
||||
def assert_params_in_request(body, required):
|
||||
absent = []
|
||||
for k in required:
|
||||
if k not in body:
|
||||
absent.append(k)
|
||||
|
||||
if len(absent) > 0:
|
||||
raise SynapseError(400, "Missing params: %r" % absent, Codes.MISSING_PARAM)
|
||||
|
||||
|
||||
class RestServlet(object):
|
||||
|
||||
""" A Synapse REST Servlet.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue