mirror of
https://github.com/TurTaskProject/TurTaskWeb.git
synced 2025-12-18 21:44:07 +01:00
fix api dashboard
This commit is contained in:
parent
cb7067de48
commit
fd58eabcab
@ -35,14 +35,12 @@ class DashboardStatsTodoViewSet(viewsets.GenericViewSet, mixins.ListModelMixin):
|
|||||||
# Task assign last week compared with this week
|
# Task assign last week compared with this week
|
||||||
tasks_assigned_last_week = Todo.objects.filter(
|
tasks_assigned_last_week = Todo.objects.filter(
|
||||||
user=user,
|
user=user,
|
||||||
completion_date__gte=start_date - timedelta(days=7),
|
creation_date__range = (start_date, start_date - timedelta(days=7))
|
||||||
completion_date__lte=start_date
|
)
|
||||||
).count()
|
|
||||||
|
|
||||||
tasks_assigned_this_week = Todo.objects.filter(
|
tasks_assigned_this_week = Todo.objects.filter(
|
||||||
user=user,
|
user=user,
|
||||||
completion_date__gte=start_date,
|
creation_date__range = (start_date, end_date)
|
||||||
completion_date__lte=end_date
|
|
||||||
).count()
|
).count()
|
||||||
|
|
||||||
# Completed tasks from last week compared with this week
|
# Completed tasks from last week compared with this week
|
||||||
@ -84,12 +82,6 @@ class DashboardStatsTodoViewSet(viewsets.GenericViewSet, mixins.ListModelMixin):
|
|||||||
completion_date__lte=today_end
|
completion_date__lte=today_end
|
||||||
).count()
|
).count()
|
||||||
|
|
||||||
total_tasks_today = Todo.objects.filter(
|
|
||||||
user=user,
|
|
||||||
start_event__gte=today_start,
|
|
||||||
end_event__lte=today_end
|
|
||||||
).count()
|
|
||||||
|
|
||||||
data = {
|
data = {
|
||||||
"completed_last_7_days": completed_last_7_days,
|
"completed_last_7_days": completed_last_7_days,
|
||||||
"tasks_assigned_last_week": tasks_assigned_last_week,
|
"tasks_assigned_last_week": tasks_assigned_last_week,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user