diff --git a/peewee.py b/peewee.py index e19210bff..27b7d2259 100644 --- a/peewee.py +++ b/peewee.py @@ -2541,7 +2541,7 @@ def last_insert_id(self, cursor, model): schema, meta.db_table, meta.primary_key.db_column)) result = cursor.fetchone()[0] if self.get_autocommit(): - self.get_conn().commit() + self.commit() return result def get_indexes_for_table(self, table):