Skip to content

Commit 5737a6e

Browse files
committed
Allow filtering by parent queues
1 parent dcb7c95 commit 5737a6e

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ linterrors3: docker
3838
docker run -i -t -v `pwd`:/app:rw -w /app pricingassistant/mrq-env python3 -m pylint -j 0 --errors-only --init-hook="import sys; sys.path.append('.')" --rcfile .pylintrc mrq
3939

4040
virtualenv:
41-
virtualenv venv --distribute
41+
virtualenv venv --distribute --python=python2.7
4242

4343
deps:
4444
pip install -r requirements.txt

mrq/dashboard/app.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,15 @@ def build_api_datatables_query(req):
153153
for param in ["queue", "path", "exceptiontype"]:
154154
if req.args.get(param):
155155
if "*" in req.args[param]:
156-
regexp = "^%s$" % re.escape(req.args[param]).replace("*", ".*")
157-
query[param] = re.compile(regexp)
156+
regexp = "^%s$" % req.args[param].replace("*", ".*")
157+
query[param] = {"$regex": regexp}
158158
else:
159159
query[param] = req.args[param]
160160

161+
if req.args.get("queue") and req.args["queue"].endswith("/"):
162+
subqueues = Queue(req.args["queue"]).get_known_subqueues()
163+
query["queue"] = {"$in": list(subqueues)}
164+
161165
if req.args.get("status"):
162166
statuses = req.args["status"].split("-")
163167
if len(statuses) == 1:

0 commit comments

Comments
 (0)