Skip to content
Snippets Groups Projects
Verified Commit 86016474 authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Also filter by weekday in TimePeriod.from_period

parent 2575db50
No related branches found
No related tags found
1 merge request!133Resolve "TimePeriod.from_period doesn't respect weekdays"
Pipeline #6102 passed
......@@ -223,7 +223,7 @@ class TimePeriod(ValidityRangeRelatedExtensibleModel):
This will respect the relation to validity ranges.
"""
return cls.objects.on_day(day).filter(period=period).first()
return cls.objects.on_day(day).filter(period=period, weekday=day.weekday()).first()
@classproperty
@cache_memoize(3600)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment