mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-25 08:44:23 -04:00
Properly parse comma-separated query string params
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
import time
|
import time
|
||||||
|
import itertools
|
||||||
|
|
||||||
from flask import (
|
from flask import (
|
||||||
render_template,
|
render_template,
|
||||||
@@ -26,14 +27,18 @@ from app.utils import (
|
|||||||
|
|
||||||
|
|
||||||
def _parse_filter_args(filter_dict):
|
def _parse_filter_args(filter_dict):
|
||||||
|
|
||||||
if not isinstance(filter_dict, MultiDict):
|
if not isinstance(filter_dict, MultiDict):
|
||||||
filter_dict = MultiDict(filter_dict)
|
filter_dict = MultiDict(filter_dict)
|
||||||
out_dict = MultiDict()
|
|
||||||
if 'type' in filter_dict:
|
return MultiDict(
|
||||||
out_dict.setlist('template_type', filter_dict.getlist('type'))
|
(
|
||||||
if 'status' in filter_dict:
|
key,
|
||||||
out_dict.setlist('status', filter_dict.getlist('status'))
|
(','.join(filter_dict.getlist(key))).split(',')
|
||||||
return out_dict
|
)
|
||||||
|
for key in filter_dict.keys()
|
||||||
|
if ''.join(filter_dict.getlist(key))
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@main.route("/services/<service_id>/jobs")
|
@main.route("/services/<service_id>/jobs")
|
||||||
@@ -144,7 +149,8 @@ def view_notifications(service_id):
|
|||||||
notifications=notifications['notifications'],
|
notifications=notifications['notifications'],
|
||||||
page=page,
|
page=page,
|
||||||
prev_page=prev_page,
|
prev_page=prev_page,
|
||||||
next_page=next_page
|
next_page=next_page,
|
||||||
|
request_args=request.args
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user