[tasks] Move to single context for task titles
This commit is contained in:
@ -421,10 +421,8 @@ def todoist_scrobble_task(
|
|||||||
# user.profile.task_context_tags which will result in context-based tag titles
|
# user.profile.task_context_tags which will result in context-based tag titles
|
||||||
# We'd also have to migrate existing tasks to the new context based ones (maybe)
|
# We'd also have to migrate existing tasks to the new context based ones (maybe)
|
||||||
for label in todoist_task["todoist_label_list"]:
|
for label in todoist_task["todoist_label_list"]:
|
||||||
if label in TODOIST_TITLE_PREFIX_LABELS:
|
if label in TODOIST_TITLE_LABELS:
|
||||||
prefix = label
|
title = label
|
||||||
if label in TODOIST_TITLE_SUFFIX_LABELS:
|
|
||||||
suffix = label
|
|
||||||
|
|
||||||
if not prefix and suffix:
|
if not prefix and suffix:
|
||||||
logger.warning(
|
logger.warning(
|
||||||
@ -432,8 +430,6 @@ def todoist_scrobble_task(
|
|||||||
extra={"todoist_scrobble_task": todoist_task},
|
extra={"todoist_scrobble_task": todoist_task},
|
||||||
)
|
)
|
||||||
|
|
||||||
title = " ".join([prefix.capitalize(), suffix.capitalize()])
|
|
||||||
|
|
||||||
task = Task.find_or_create(title)
|
task = Task.find_or_create(title)
|
||||||
|
|
||||||
timestamp = pendulum.parse(todoist_task.get("updated_at", timezone.now()))
|
timestamp = pendulum.parse(todoist_task.get("updated_at", timezone.now()))
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
TODOIST_TITLE_PREFIX_LABELS = ["work", "home", "personal"]
|
TODOIST_TITLE_LABELS = [
|
||||||
TODOIST_TITLE_SUFFIX_LABELS = [
|
|
||||||
"bug",
|
"bug",
|
||||||
"project",
|
"feature",
|
||||||
"errand",
|
"errand",
|
||||||
"chore",
|
"chore",
|
||||||
"admin",
|
"admin",
|
||||||
|
"baking",
|
||||||
"meeting",
|
"meeting",
|
||||||
"habit",
|
"habit",
|
||||||
"research",
|
"research",
|
||||||
|
|||||||
Reference in New Issue
Block a user