Skip to content

Commit

Permalink
Merge pull request #91 from SeanHood/master
Browse files Browse the repository at this point in the history
Fixes AttributeError when cursor.lastrowid doesn't exist
  • Loading branch information
tredman authored Nov 19, 2019
2 parents 4512fc1 + 017a08b commit b8bb3c9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion beeline/middleware/flask/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def after_cursor_execute(self, conn, cursor, statement, parameters, context, exe

beeline.add_context({
"db.duration": query_duration.total_seconds() * 1000,
"db.last_insert_id": cursor.lastrowid,
"db.last_insert_id": getattr(cursor, 'lastrowid', None),
"db.rows_affected": cursor.rowcount,
})
if self.state.span:
Expand Down

0 comments on commit b8bb3c9

Please sign in to comment.