From ccf14c51bf9bf7656dcc4b9d939b0a07972c2b0f Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Tue, 15 Oct 2024 14:41:40 -0400 Subject: [PATCH] [tasks] Fix webhook creating duplicates --- vrobbler/apps/tasks/webhooks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vrobbler/apps/tasks/webhooks.py b/vrobbler/apps/tasks/webhooks.py index b0fcdb2..f400375 100644 --- a/vrobbler/apps/tasks/webhooks.py +++ b/vrobbler/apps/tasks/webhooks.py @@ -52,10 +52,10 @@ def todoist_webhook(request): return Response({}, status=status.HTTP_304_NOT_MODIFIED) scrobble = None - if "inprogress" in todoist_task["todoist_label_list"]: - scrobble = todoist_scrobble_task(todoist_task, request.user.id) if "completed" in todoist_task["todoist_event"]: scrobble = todoist_scrobble_task_finish(todoist_task, request.user.id) + elif "inprogress" in todoist_task["todoist_label_list"]: + scrobble = todoist_scrobble_task(todoist_task, request.user.id) if not scrobble: return Response({}, status=status.HTTP_400_BAD_REQUEST)