[tasks] Actually add the new utils file

This commit is contained in:
2025-06-26 14:50:11 -04:00
parent a7eca4b9a7
commit 40b54b27f4

View File

@ -0,0 +1,19 @@
import logging
from tasks.constants import TODOIST_TITLE_LABELS
logger = logging.getLogger(__name__)
def get_title_from_labels(labels: list[str]) -> str:
title = "Unknown"
for label in labels:
if label in TODOIST_TITLE_LABELS:
title = label.capitalize()
if title == "Unknown":
logger.warning(
"Missing a prefix and suffix tag for task",
extra={"labels": labels},
)
return title