[task] Ooops, add task id

This commit is contained in:
2024-11-01 12:59:53 -04:00
parent 82dcad569a
commit 59d681dc00
2 changed files with 4 additions and 5 deletions

View File

@ -324,7 +324,7 @@ def todoist_scrobble_update_task(
scrobble = Scrobble.objects.filter( scrobble = Scrobble.objects.filter(
in_progress=True, in_progress=True,
user_id=user_id, user_id=user_id,
log__task_id=todoist_note.get("task_id"), log__todoist_id=todoist_note.get("task_id"),
).first() ).first()
if not scrobble: if not scrobble:
@ -339,9 +339,7 @@ def todoist_scrobble_update_task(
return return
existing_notes = scrobble.log.get("notes", {}) existing_notes = scrobble.log.get("notes", {})
existing_notes[todoist_note.get("todoist_id")] = todoist_note.get( existing_notes[todoist_note.get("todoist_id")] = todoist_note.get("notes")
"content"
)
scrobble.log["notes"] = existing_notes scrobble.log["notes"] = existing_notes
scrobble.save(update_fields=["log"]) scrobble.save(update_fields=["log"])
logger.info( logger.info(

View File

@ -61,7 +61,8 @@ def todoist_webhook(request):
if is_note_type and is_added: if is_note_type and is_added:
task_data = event_data.get("item", {}) task_data = event_data.get("item", {})
todoist_note = { todoist_note = {
"todoist_id": task_data.get("id"), "task_id": event_data.get("item_id"),
"todoist_id": event_data.get("id"),
"todoist_label_list": task_data.get("labels"), "todoist_label_list": task_data.get("labels"),
"todoist_type": todoist_type, "todoist_type": todoist_type,
"todoist_event": todoist_event, "todoist_event": todoist_event,