summary refs log tree commit diff
path: root/synapse/storage/pusher.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-04-29 19:27:02 +0100
committerErik Johnston <erik@matrix.org>2015-04-29 19:27:02 +0100
commit4a9dc5b2f55fa07e4f43445c3b993cf1fd330d71 (patch)
treeb07a615e35cfce677c345116b32d38fc3442caa2 /synapse/storage/pusher.py
parentTypo (diff)
downloadsynapse-4a9dc5b2f55fa07e4f43445c3b993cf1fd330d71.tar.xz
pushkey' are also bytes.
Diffstat (limited to 'synapse/storage/pusher.py')
-rw-r--r--synapse/storage/pusher.py25
1 files changed, 17 insertions, 8 deletions
diff --git a/synapse/storage/pusher.py b/synapse/storage/pusher.py
index c2aaf60286..752b451c46 100644
--- a/synapse/storage/pusher.py
+++ b/synapse/storage/pusher.py
@@ -29,15 +29,22 @@ logger = logging.getLogger(__name__)
 class PusherStore(SQLBaseStore):
     @defer.inlineCallbacks
     def get_pushers_by_app_id_and_pushkey(self, app_id, pushkey):
-        sql = (
-            "SELECT * FROM pushers "
-            "WHERE app_id = ? AND pushkey = ?"
-        )
+        def r(txn):
+            sql = (
+                "SELECT * FROM pushers"
+                " WHERE app_id = ? AND pushkey = ?"
+            )
 
-        rows = yield self._execute_and_decode(
-            "get_pushers_by_app_id_and_pushkey",
-            sql,
-            app_id, pushkey
+            txn.execute(sql, (app_id, pushkey,))
+            rows = self.cursor_to_dict(txn)
+
+            for r in rows:
+                r['pushkey'] = str(r['pushkey']).decode("UTF8")
+
+            return rows
+
+        rows = yield self.runInteraction(
+            "get_pushers_by_app_id_and_pushkey", r
         )
 
         defer.returnValue(rows)
@@ -60,6 +67,8 @@ class PusherStore(SQLBaseStore):
                     )
                     pass
 
+                r['pushkey'] = str(r['pushkey']).decode("UTF8")
+
             return rows
 
         rows = yield self.runInteraction("get_all_pushers", get_pushers)