Skip to content

Commit

Permalink
Merge pull request #13503 from carkod/fix-iot-filter-wd-8457
Browse files Browse the repository at this point in the history
Fix IoT and Server SoC filter
  • Loading branch information
carkod authored Feb 1, 2024
2 parents 3bb3e7a + e05d41d commit 5641892
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,3 @@ google-cloud-datastore==2.16.1
django-openid-auth==0.17
time-machine==2.9.0
filelock==3.12.0
bleach==6.0.0
12 changes: 5 additions & 7 deletions webapp/certified/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import talisker.sentry
import requests
import math
import bleach

from flask import (
request,
Expand Down Expand Up @@ -102,12 +101,12 @@ def _parse_query_params(all_releases, all_vendors):
"servers",
"iot",
"socs",
"Ubuntu Core",
"Server SoC",
]:
for item in request.args.getlist("category"):
if request.args["category"] == "Ubuntu Core":
item = "IoT"
if request.args["category"] == "Server SoC":
item = "SoC"
if item in category_params:
continue
if item == category:
new_query_params["category"] = category_params.append(
category
Expand Down Expand Up @@ -714,9 +713,8 @@ def create_category_views(category, template_path):
"""
if len(request.args.getlist("category")) > 1:
url = f"/certified?{request.query_string.decode()}&category={category}"
clean_url = bleach.clean(url, tags=[], strip=True)
# UX requirement
return redirect(clean_url)
return redirect(url)

if category == "Desktop":
certified_releases = api.certified_releases(
Expand Down

0 comments on commit 5641892

Please sign in to comment.