[tasks] Remove in-progress tag to stop
This commit is contained in:
@ -348,11 +348,16 @@ def todoist_scrobble_task(todoist_task: dict, user_id: int) -> Scrobble:
|
||||
|
||||
task = Task.find_or_create(title)
|
||||
in_progress_scrobble = Scrobble.objects.filter(
|
||||
in_progress=True, log__todoist_id=todoist_task.get("todoist_id")
|
||||
in_progress=True,
|
||||
log__todoist_id=todoist_task.get("todoist_id"),
|
||||
task=task,
|
||||
).first()
|
||||
if in_progress_scrobble:
|
||||
return in_progress_scrobble
|
||||
|
||||
if "inprogress" not in todoist_task["todoist_label_list"]:
|
||||
return todoist_scrobble_task_finish(todoist_task, user_id)
|
||||
|
||||
# TODO Should use updated_at from TOdoist, but parsing isn't working
|
||||
scrobble_dict = {
|
||||
"user_id": user_id,
|
||||
|
||||
@ -60,10 +60,9 @@ def todoist_webhook(request):
|
||||
if not user_id:
|
||||
user_id = 1
|
||||
|
||||
scrobble = None
|
||||
if "completed" in todoist_task["todoist_event"]:
|
||||
scrobble = todoist_scrobble_task_finish(todoist_task, user_id)
|
||||
elif "inprogress" in todoist_task["todoist_label_list"]:
|
||||
else:
|
||||
scrobble = todoist_scrobble_task(todoist_task, user_id)
|
||||
|
||||
if not scrobble:
|
||||
|
||||
Reference in New Issue
Block a user