From 4361311e5b9ea90dbeaf197013e9f0699da991c4 Mon Sep 17 00:00:00 2001 From: Samuel Cattini-Schultz Date: Sun, 22 Dec 2024 22:38:39 +1100 Subject: [PATCH] Fix mod filters being broken on score list loading --- profiles/views.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/profiles/views.py b/profiles/views.py index 226ac5a..0313fd5 100644 --- a/profiles/views.py +++ b/profiles/views.py @@ -97,8 +97,8 @@ def get(self, request, user_id, gamemode): """ Return Scores based on a user_id, gamemode, score_set, and various filters """ - if "required_mods_json" in request.query_params: - required_mods_json = request.query_params["required_mods_json"] + if "required_mods_json[]" in request.query_params: + required_mods_json = request.query_params.getlist("required_mods_json[]") required_mods = get_bitwise_mods(required_mods_json) else: required_mods = parse_int_or_none( @@ -108,8 +108,10 @@ def get(self, request, user_id, gamemode): get_mod_acronyms(required_mods) if required_mods is not None else [] ) - if "disqualified_mods_json" in request.query_params: - disqualified_mods_json = request.query_params["disqualified_mods_json"] + if "disqualified_mods_json[]" in request.query_params: + disqualified_mods_json = request.query_params.getlist( + "disqualified_mods_json[]" + ) disqualified_mods = get_bitwise_mods(disqualified_mods_json) else: disqualified_mods = parse_int_or_none(