summary refs log tree commit diff
path: root/synapse/appservice/api.py
diff options
context:
space:
mode:
authorKegan Dougal <kegan@matrix.org>2016-08-30 17:16:00 +0100
committerKegan Dougal <kegan@matrix.org>2016-08-30 17:16:00 +0100
commit572acde4832869c8f7f4daf555296bd1164364d0 (patch)
tree86f13817a8e68fe6e5fc9d7915314523734f3a5c /synapse/appservice/api.py
parentFlake8 (diff)
downloadsynapse-572acde4832869c8f7f4daf555296bd1164364d0.tar.xz
Use None instead of the empty string
Change how we validate the 'url' field as a result.
Diffstat (limited to 'synapse/appservice/api.py')
-rw-r--r--synapse/appservice/api.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/synapse/appservice/api.py b/synapse/appservice/api.py
index ee63f06359..cc4af23962 100644
--- a/synapse/appservice/api.py
+++ b/synapse/appservice/api.py
@@ -67,7 +67,7 @@ class ApplicationServiceApi(SimpleHttpClient):
 
     @defer.inlineCallbacks
     def query_user(self, service, user_id):
-        if service.url == "":
+        if service.url is None:
             defer.returnValue(False)
         uri = service.url + ("/users/%s" % urllib.quote(user_id))
         response = None
@@ -88,7 +88,7 @@ class ApplicationServiceApi(SimpleHttpClient):
 
     @defer.inlineCallbacks
     def query_alias(self, service, alias):
-        if service.url == "":
+        if service.url is None:
             defer.returnValue(False)
         uri = service.url + ("/rooms/%s" % urllib.quote(alias))
         response = None
@@ -117,7 +117,7 @@ class ApplicationServiceApi(SimpleHttpClient):
             raise ValueError(
                 "Unrecognised 'kind' argument %r to query_3pe()", kind
             )
-        if service.url == "":
+        if service.url is None:
             defer.returnValue([])
 
         uri = "%s%s/thirdparty/%s/%s" % (
@@ -151,7 +151,7 @@ class ApplicationServiceApi(SimpleHttpClient):
             defer.returnValue([])
 
     def get_3pe_protocol(self, service, protocol):
-        if service.url == "":
+        if service.url is None:
             defer.returnValue({})
 
         @defer.inlineCallbacks
@@ -175,7 +175,7 @@ class ApplicationServiceApi(SimpleHttpClient):
 
     @defer.inlineCallbacks
     def push_bulk(self, service, events, txn_id=None):
-        if service.url == "":
+        if service.url is None:
             defer.returnValue(True)
 
         events = self._serialize(events)