mirror of
https://github.com/element-hq/synapse
synced 2024-08-20 14:20:23 +00:00
pushkey' are also bytes.
This commit is contained in:
parent
0ade2712d1
commit
4a9dc5b2f5
1 changed files with 17 additions and 8 deletions
|
@ -29,15 +29,22 @@ logger = logging.getLogger(__name__)
|
||||||
class PusherStore(SQLBaseStore):
|
class PusherStore(SQLBaseStore):
|
||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
def get_pushers_by_app_id_and_pushkey(self, app_id, pushkey):
|
def get_pushers_by_app_id_and_pushkey(self, app_id, pushkey):
|
||||||
sql = (
|
def r(txn):
|
||||||
"SELECT * FROM pushers "
|
sql = (
|
||||||
"WHERE app_id = ? AND pushkey = ?"
|
"SELECT * FROM pushers"
|
||||||
)
|
" WHERE app_id = ? AND pushkey = ?"
|
||||||
|
)
|
||||||
|
|
||||||
rows = yield self._execute_and_decode(
|
txn.execute(sql, (app_id, pushkey,))
|
||||||
"get_pushers_by_app_id_and_pushkey",
|
rows = self.cursor_to_dict(txn)
|
||||||
sql,
|
|
||||||
app_id, pushkey
|
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)
|
defer.returnValue(rows)
|
||||||
|
@ -60,6 +67,8 @@ class PusherStore(SQLBaseStore):
|
||||||
)
|
)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
r['pushkey'] = str(r['pushkey']).decode("UTF8")
|
||||||
|
|
||||||
return rows
|
return rows
|
||||||
|
|
||||||
rows = yield self.runInteraction("get_all_pushers", get_pushers)
|
rows = yield self.runInteraction("get_all_pushers", get_pushers)
|
||||||
|
|
Loading…
Reference in a new issue