fixed seminar day calculation again

pull/153/head
mariusrklein 8 months ago
parent 95b900db1e
commit 31eec46f71

@ -1314,8 +1314,8 @@ class Freizeit(CommonModel):
.annotate(total_duration=Sum('duration'))# Sum durations for each day
.annotate(
sum_days=Case(
When(total_duration__gt=5.0, then=Value(1.0)),
When(total_duration__gt=2.5, then=Value(0.5)),
When(total_duration__gte=5.0, then=Value(1.0)),
When(total_duration__gte=2.5, then=Value(0.5)),
default=Value(0.0),)
)
.order_by('day') # Sort results by date

Loading…
Cancel
Save