Skip to content

Commit

Permalink
Fix adding first tag
Browse files Browse the repository at this point in the history
  • Loading branch information
JanisV committed Sep 14, 2023
1 parent a2500ba commit 129c917
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions OpenNumismat/TagsDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 129c917

Please sign in to comment.