diff --git a/OpenNumismat/TagsDialog.py b/OpenNumismat/TagsDialog.py index 556aa65e..3fd28c8f 100644 --- a/OpenNumismat/TagsDialog.py +++ b/OpenNumismat/TagsDialog.py @@ -188,9 +188,10 @@ def _getNewPosition(self): sql = "SELECT MAX(id) FROM tags" query = QSqlQuery(sql, self.db) query.exec_() + query.first() + max_id = query.record().value(0) - if query.first(): - max_id = query.record().value(0) + if max_id: position = max_id + 1 else: position = 0