Skip to content

Commit

Permalink
update filter
Browse files Browse the repository at this point in the history
  • Loading branch information
ihfazhillah committed Jun 2, 2024
1 parent 133a373 commit 27af34c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ksatria_muslim/children_task/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ def serialize_task(history: TaskHistory, request=None):
def get_task_list(request, child_id):
today = timezone.localdate()
tasks = TaskHistory.objects.filter(
child_id=child_id, task__active=True, task__days__contains=[today.isoweekday()]
child_id=child_id,
task__active=True,
task__days__contains=[today.isoweekday()],
created_at__date=today
).order_by("task__scheduled_at", "task__title")
return Response({"tasks": [serialize_task(task, request) for task in tasks]})

Expand Down

0 comments on commit 27af34c

Please sign in to comment.