From 60dfb0e8ebaed3fc238d0c4c8e093b3ec086db55 Mon Sep 17 00:00:00 2001 From: Rifki Kusmana Date: Mon, 20 Oct 2025 16:34:52 +0700 Subject: [PATCH] Fix default school selection to Any --- src/pages/index.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pages/index.py b/src/pages/index.py index d8e284b..ec20b89 100644 --- a/src/pages/index.py +++ b/src/pages/index.py @@ -34,10 +34,10 @@ def index_page_sub(campus: str, campus_url: str) -> Response: level = request.args.get("level", "") semester = request.args.get("semester", "") school_cookie = request.cookies.get(LAST_SCHOOL_COOKIE, "") - school = request.args.get( - "school", - school_cookie if school_cookie in school_options else school_options[0], - ) + # Default to the empty string (which corresponds to the "Any" option in + # the template) when there is no valid cookie or request parameter. + default_school = school_cookie if school_cookie in school_options else "" + school = request.args.get("school", default_school) # Assemble SQL query parameters = [campus]