Просмотр исходного кода

[tasks] Add Bug as suffix type

Colin Powell 8 месяцев назад
Родитель
Сommit
f075492554
2 измененных файлов с 7 добавлено и 0 удалено
  1. 6 0
      vrobbler/apps/scrobbles/scrobblers.py
  2. 1 0
      vrobbler/apps/tasks/constants.py

+ 6 - 0
vrobbler/apps/scrobbles/scrobblers.py

@@ -344,6 +344,12 @@ def todoist_scrobble_task(todoist_task: dict, user_id: int) -> Scrobble:
         if label in TODOIST_TITLE_SUFFIX_LABELS:
             suffix = label
 
+    if not prefix and suffix:
+        logger.warning(
+            "Missing a prefix and suffix tag for task",
+            extra={"todoist_task": todoist_task},
+        )
+
     title = " ".join([prefix.capitalize(), suffix.capitalize()])
 
     task = Task.find_or_create(title)

+ 1 - 0
vrobbler/apps/tasks/constants.py

@@ -1,5 +1,6 @@
 TODOIST_TITLE_PREFIX_LABELS = ["work", "home", "personal"]
 TODOIST_TITLE_SUFFIX_LABELS = [
+    "bug",
     "project",
     "errand",
     "chores",