mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-12-27 05:49:24 -05:00
Fix pyflakes errors
This commit is contained in:
parent
574377636e
commit
b9cdc443d7
@ -176,7 +176,7 @@ class RegistrationHandler(BaseHandler):
|
|||||||
|
|
||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
def _bind_threepid(self, creds, mxid):
|
def _bind_threepid(self, creds, mxid):
|
||||||
httpCli = PlainHttpClient(self.hs)
|
httpCli = IdentityServerHttpClient(self.hs)
|
||||||
data = yield httpCli.post_urlencoded_get_json(
|
data = yield httpCli.post_urlencoded_get_json(
|
||||||
creds['idServer'],
|
creds['idServer'],
|
||||||
"/_matrix/identity/api/v1/3pid/bind",
|
"/_matrix/identity/api/v1/3pid/bind",
|
||||||
|
@ -236,9 +236,6 @@ class IdentityServerHttpClient(BaseHttpClient):
|
|||||||
|
|
||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
def post_urlencoded_get_json(self, destination, path, args={}):
|
def post_urlencoded_get_json(self, destination, path, args={}):
|
||||||
if destination in _destination_mappings:
|
|
||||||
destination = _destination_mappings[destination]
|
|
||||||
|
|
||||||
logger.debug("post_urlencoded_get_json args: %s", args)
|
logger.debug("post_urlencoded_get_json args: %s", args)
|
||||||
query_bytes = urllib.urlencode(args, True)
|
query_bytes = urllib.urlencode(args, True)
|
||||||
|
|
||||||
@ -246,7 +243,7 @@ class IdentityServerHttpClient(BaseHttpClient):
|
|||||||
destination.encode("ascii"),
|
destination.encode("ascii"),
|
||||||
"POST",
|
"POST",
|
||||||
path.encode("ascii"),
|
path.encode("ascii"),
|
||||||
producer=FileBodyProducer(StringIO(urllib.urlencode(args))),
|
producer=FileBodyProducer(StringIO(query_bytes)),
|
||||||
headers_dict={
|
headers_dict={
|
||||||
"Content-Type": ["application/x-www-form-urlencoded"]
|
"Content-Type": ["application/x-www-form-urlencoded"]
|
||||||
}
|
}
|
||||||
@ -266,16 +263,13 @@ class CaptchaServerHttpClient(MatrixHttpClient):
|
|||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
def post_urlencoded_get_raw(self, destination, path, accept_partial=False,
|
def post_urlencoded_get_raw(self, destination, path, accept_partial=False,
|
||||||
args={}):
|
args={}):
|
||||||
if destination in _destination_mappings:
|
|
||||||
destination = _destination_mappings[destination]
|
|
||||||
|
|
||||||
query_bytes = urllib.urlencode(args, True)
|
query_bytes = urllib.urlencode(args, True)
|
||||||
|
|
||||||
response = yield self._create_request(
|
response = yield self._create_request(
|
||||||
destination.encode("ascii"),
|
destination.encode("ascii"),
|
||||||
"POST",
|
"POST",
|
||||||
path.encode("ascii"),
|
path.encode("ascii"),
|
||||||
producer=FileBodyProducer(StringIO(urllib.urlencode(args))),
|
producer=FileBodyProducer(StringIO(query_bytes)),
|
||||||
headers_dict={
|
headers_dict={
|
||||||
"Content-Type": ["application/x-www-form-urlencoded"]
|
"Content-Type": ["application/x-www-form-urlencoded"]
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user