From f07549255489f1c499c069a6f3c6e8d62a51fa78 Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Tue, 15 Oct 2024 15:12:58 -0400 Subject: [PATCH] [tasks] Add Bug as suffix type --- vrobbler/apps/scrobbles/scrobblers.py | 6 ++++++ vrobbler/apps/tasks/constants.py | 1 + 2 files changed, 7 insertions(+) diff --git a/vrobbler/apps/scrobbles/scrobblers.py b/vrobbler/apps/scrobbles/scrobblers.py index 2d49cc9..4453ba8 100644 --- a/vrobbler/apps/scrobbles/scrobblers.py +++ b/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) diff --git a/vrobbler/apps/tasks/constants.py b/vrobbler/apps/tasks/constants.py index a004baf..ac01ddf 100644 --- a/vrobbler/apps/tasks/constants.py +++ b/vrobbler/apps/tasks/constants.py @@ -1,5 +1,6 @@ TODOIST_TITLE_PREFIX_LABELS = ["work", "home", "personal"] TODOIST_TITLE_SUFFIX_LABELS = [ + "bug", "project", "errand", "chores",