From 020e12e20bbd80cfe3247cc8a204547fdcdf8f18 Mon Sep 17 00:00:00 2001 From: Lukas Kucharczyk Date: Sun, 11 Aug 2024 17:58:08 +0200 Subject: [PATCH] remove session recent filter --- games/urls.py | 6 ------ games/views.py | 8 +------- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/games/urls.py b/games/urls.py index 9f61d3d..5992d0e 100644 --- a/games/urls.py +++ b/games/urls.py @@ -82,12 +82,6 @@ urlpatterns = [ name="list_sessions_end_session", ), path("session/list", sessionviews.list_sessions, name="list_sessions"), - path( - "session/list/recent", - views.list_sessions, - {"filter": "recent"}, - name="list_sessions_recent", - ), path( "session/list/by-purchase/", views.list_sessions, diff --git a/games/views.py b/games/views.py index bf69a45..7690140 100644 --- a/games/views.py +++ b/games/views.py @@ -342,12 +342,6 @@ def list_sessions( elif filter == "ownership_type": dataset = all_sessions.filter(purchase__ownership_type=ownership_type) context["ownership_type"] = dict(Purchase.OWNERSHIP_TYPES)[ownership_type] - elif filter == "recent": - current_year = timezone.now().year - first_day_of_year = timezone.make_aware(datetime(current_year, 1, 1)) - dataset = all_sessions.filter(timestamp_start__gte=first_day_of_year).order_by( - "-timestamp_start" - ) context["title"] = "This year" else: dataset = all_sessions @@ -949,4 +943,4 @@ def add_device(request: HttpRequest) -> HttpResponse: @login_required def index(request: HttpRequest) -> HttpResponse: - return redirect("list_sessions_recent") + return redirect("list_sessions")