diff --git a/api/clockify.py b/api/clockify.py index 6ad97a8..f0bf98c 100644 --- a/api/clockify.py +++ b/api/clockify.py @@ -60,7 +60,7 @@ class ClockifyAPI(ClockifyConfig): if not tag: tag = self.get_tags(True, tag_id=tag_id) if tag: - db.insert_tags([tag]) + db.insert_tags([tag] if isinstance(tag, Tag) else tag) from config import red try: task_id = parse_task_id(tag.title) diff --git a/db/db.py b/db/db.py index 68e5b2e..4c50df6 100644 --- a/db/db.py +++ b/db/db.py @@ -110,7 +110,7 @@ class Database: """Сохраняет в базу данных теги Clockify""" for tag in tags: try: - self.cursor.execute("INSERT INTO tag VALUES(?, ?)",(tag.id,tag.title)) + self.cursor.execute("INSERT INTO tag VALUES(?, ?)",(tag.id, tag.title)) except sq.IntegrityError: self.cursor.execute( """UPDATE tag