Fix bugs Habitica to-do lists (#121755)

pull/121758/head
Mr. Bubbles 2024-07-11 09:11:04 +02:00 committed by GitHub
parent 43596f22a4
commit c6f1ec34e2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 2 deletions

View File

@ -127,6 +127,7 @@ class BaseHabiticaListEntity(HabiticaBase, TodoListEntity):
if (
self.entity_description.key is HabiticaTodoList.TODOS
and item.due is not None
): # Only todos support a due date.
date = item.due.isoformat()
else:
@ -149,14 +150,14 @@ class BaseHabiticaListEntity(HabiticaBase, TodoListEntity):
# Score up or down if item status changed
if (
current_item.status is TodoItemStatus.NEEDS_ACTION
and item.status is TodoItemStatus.COMPLETED
and item.status == TodoItemStatus.COMPLETED
):
score_result = (
await self.coordinator.api.tasks[item.uid].score["up"].post()
)
elif (
current_item.status is TodoItemStatus.COMPLETED
and item.status is TodoItemStatus.NEEDS_ACTION
and item.status == TodoItemStatus.NEEDS_ACTION
):
score_result = (
await self.coordinator.api.tasks[item.uid].score["down"].post()