summary refs log tree commit diff
path: root/synapse/storage/transactions.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-03-20 15:05:44 +0000
committerErik Johnston <erik@matrix.org>2015-03-20 15:05:44 +0000
commitfce01140057c54714b591aa327095dcee9936b4b (patch)
tree9bcf859cb130519b239facb480db6882cc6ded7a /synapse/storage/transactions.py
parentTidy up _simple_... methods (diff)
downloadsynapse-fce01140057c54714b591aa327095dcee9936b4b.tar.xz
Start removing Tables
Diffstat (limited to 'synapse/storage/transactions.py')
-rw-r--r--synapse/storage/transactions.py20
1 files changed, 12 insertions, 8 deletions
diff --git a/synapse/storage/transactions.py b/synapse/storage/transactions.py

index 0b8a3b7a07..b777395e06 100644 --- a/synapse/storage/transactions.py +++ b/synapse/storage/transactions.py
@@ -46,15 +46,19 @@ class TransactionStore(SQLBaseStore): ) def _get_received_txn_response(self, txn, transaction_id, origin): - where_clause = "transaction_id = ? AND origin = ?" - query = ReceivedTransactionsTable.select_statement(where_clause) - - txn.execute(query, (transaction_id, origin)) - - results = ReceivedTransactionsTable.decode_results(txn.fetchall()) + result = self._simple_select_one_txn( + txn, + table=ReceivedTransactionsTable.table_name, + keyvalues={ + "transaction_id": transaction_id, + "origin": origin, + }, + retcols=ReceivedTransactionsTable.fields, + allow_none=True, + ) - if results and results[0].response_code: - return (results[0].response_code, results[0].response_json) + if result and result.response_code: + return result["response_code"], result["response_json"] else: return None