From f313b2159f16e1d8b297121218ef04c8d708e67b Mon Sep 17 00:00:00 2001 From: Morgan McMillian Date: Sat, 4 Mar 2017 14:42:40 -0800 Subject: [PATCH] fix return of query object --- appservice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appservice.py b/appservice.py index 1949dbb..2b9da66 100644 --- a/appservice.py +++ b/appservice.py @@ -26,7 +26,7 @@ def on_receive_events(transaction): events = request.get_json()["events"] for event in events: logging.debug(event) - user = MatrixUser.query.filter_by(matrix_id=event["user_id"]) + user = MatrixUser.query.filter_by(matrix_id=event["user_id"]).first() if (event['type'] == 'm.room.message' and not app.config['MATRIX_PNUT_PREFIX'] in event["user_id"]