From 129c9172699ee4da95518111f58c5594771bb5ac Mon Sep 17 00:00:00 2001 From: Janis Date: Thu, 14 Sep 2023 13:04:16 +0300 Subject: [PATCH] Fix adding first tag --- OpenNumismat/TagsDialog.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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