mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 21:44:52 -04:00
rename assert_params_in_request to assert_params_in_dict
the method "assert_params_in_request" does handle dicts and not requests. A request body has to be parsed to json before this method can be used
This commit is contained in:
parent
32fd6910d0
commit
3366b9c534
11 changed files with 33 additions and 33 deletions
|
@ -23,7 +23,7 @@ from twisted.internet import defer
|
|||
from synapse.api.errors import Codes, SynapseError
|
||||
from synapse.http.servlet import (
|
||||
RestServlet,
|
||||
assert_params_in_request,
|
||||
assert_params_in_dict,
|
||||
parse_json_object_from_request,
|
||||
)
|
||||
|
||||
|
@ -50,7 +50,7 @@ class ReportEventRestServlet(RestServlet):
|
|||
user_id = requester.user.to_string()
|
||||
|
||||
body = parse_json_object_from_request(request)
|
||||
assert_params_in_request(body, ("reason", "score"))
|
||||
assert_params_in_dict(body, ("reason", "score"))
|
||||
|
||||
if not isinstance(body["reason"], string_types):
|
||||
raise SynapseError(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue