summary refs log tree commit diff
path: root/synapse/rest
diff options
context:
space:
mode:
authorDavid Baker <dave@matrix.org>2018-05-24 16:20:53 +0100
committerDavid Baker <dave@matrix.org>2018-05-24 16:20:53 +0100
commit77a23e2e058bbc02a675bd6e14bff2c9906c68b2 (patch)
tree5b65ad8562dc2d584b35b47999b5e004ad21b387 /synapse/rest
parentpep8 (diff)
parentMerge pull request #3277 from matrix-org/dbkr/remove_from_user_dir (diff)
downloadsynapse-77a23e2e058bbc02a675bd6e14bff2c9906c68b2.tar.xz
Merge remote-tracking branch 'origin/develop' into dbkr/unbind
Diffstat (limited to 'synapse/rest')
-rw-r--r--synapse/rest/client/v1/presence.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/synapse/rest/client/v1/presence.py b/synapse/rest/client/v1/presence.py
index 4a73813c58..647994bd53 100644
--- a/synapse/rest/client/v1/presence.py
+++ b/synapse/rest/client/v1/presence.py
@@ -23,6 +23,8 @@ from synapse.handlers.presence import format_user_presence_state
 from synapse.http.servlet import parse_json_object_from_request
 from .base import ClientV1RestServlet, client_path_patterns
 
+from six import string_types
+
 import logging
 
 logger = logging.getLogger(__name__)
@@ -71,7 +73,7 @@ class PresenceStatusRestServlet(ClientV1RestServlet):
 
             if "status_msg" in content:
                 state["status_msg"] = content.pop("status_msg")
-                if not isinstance(state["status_msg"], basestring):
+                if not isinstance(state["status_msg"], string_types):
                     raise SynapseError(400, "status_msg must be a string.")
 
             if content:
@@ -129,7 +131,7 @@ class PresenceListRestServlet(ClientV1RestServlet):
 
         if "invite" in content:
             for u in content["invite"]:
-                if not isinstance(u, basestring):
+                if not isinstance(u, string_types):
                     raise SynapseError(400, "Bad invite value.")
                 if len(u) == 0:
                     continue
@@ -140,7 +142,7 @@ class PresenceListRestServlet(ClientV1RestServlet):
 
         if "drop" in content:
             for u in content["drop"]:
-                if not isinstance(u, basestring):
+                if not isinstance(u, string_types):
                     raise SynapseError(400, "Bad drop value.")
                 if len(u) == 0:
                     continue