diff --git a/techrec/server.py b/techrec/server.py index c23700a..f987b12 100644 --- a/techrec/server.py +++ b/techrec/server.py @@ -76,7 +76,7 @@ def create(): now = datetime.now() start = date_read(req["starttime"]) if "starttime" in req else now - name = req["name"] if "name" in req else u"" + name = req["name"] if "name" in req else "" end = date_read(req["endtime"]) if "endtime" in req else now rec = Rec(name=name, starttime=start, endtime=end) @@ -222,15 +222,15 @@ def check_job(job_id: int): @app.get("/api/jobs") def running_jobs(): res = {} - res["last_job_id"] = self._app.pq.last_job_id - res["running"] = self._app.pq.jobs.keys() + res["last_job_id"] = pq.last_job_id + res["running"] = pq.jobs.keys() return res @app.get("/api/get/search") -def search(args=None): +def search(request: Request): req = dict() - req.update(request.GET.allitems()) + req.update(request.query_params.items()) logger.debug("Search request: %s" % (req)) values = db._search(**req)