mirror of
https://github.com/ae-utbm/sith.git
synced 2025-02-27 01:47:14 +00:00
Apply review comments
This commit is contained in:
parent
a01ea13f5b
commit
a653f98fc1
@ -261,15 +261,13 @@ class NewsListView(TemplateView):
|
||||
D on 20/03, E on 21/03 and F on 22/03 ;
|
||||
then the result is 20/03.
|
||||
"""
|
||||
try:
|
||||
return list(
|
||||
dates = list(
|
||||
NewsDate.objects.filter(end_date__gt=now())
|
||||
.order_by("start_date")
|
||||
.values_list("start_date__date", flat=True)
|
||||
.distinct()[:4]
|
||||
)[-1]
|
||||
except IndexError:
|
||||
return None
|
||||
)
|
||||
return dates[-1] if len(dates) > 0 else None
|
||||
|
||||
def get_news_dates(self, until: date) -> dict[date, list[date]]:
|
||||
"""Return the event dates to display.
|
||||
|
Loading…
x
Reference in New Issue
Block a user