Skip to content

Commit

Permalink
Fix access type end_date using outer ref
Browse files Browse the repository at this point in the history
  • Loading branch information
matti-lamppu committed Feb 27, 2025
1 parent fb04690 commit eb4896f
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ def end_date() -> datetime.date:
sq = Coalesce(
models.Subquery(
queryset=(
ReservationUnitAccessType.objects.filter(begin_date__gt=models.OuterRef("begin_date"))
ReservationUnitAccessType.objects.filter(
begin_date__gt=models.OuterRef("begin_date"),
reservation_unit=models.OuterRef("reservation_unit"),
)
.order_by("begin_date")
.values("begin_date")[:1]
),
Expand Down

0 comments on commit eb4896f

Please sign in to comment.