From 6ca37d1255b40fe18256c68423d9a3e24b9e46ee Mon Sep 17 00:00:00 2001 From: okhin Date: Fri, 17 Feb 2017 18:15:18 +0100 Subject: [PATCH 1/4] Let's urlunqoute the filter --- src/representatives/filters.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/representatives/filters.py b/src/representatives/filters.py index a0807f3..aaf247d 100644 --- a/src/representatives/filters.py +++ b/src/representatives/filters.py @@ -4,6 +4,7 @@ from datetime import datetime from rest_framework.filters import BaseFilterBackend from django.db.models import Q from django.conf import settings +from django.utils.http import urlunquote from .models import Mandate @@ -49,7 +50,7 @@ class ActiveConstituencyFilterBackend(BaseFilterBackend): if self.query_param in request.GET: if len(request.GET[self.query_params]): - mandates = request.GET[self.query_param].split(',') + mandates = urlunqoute(request.GET[self.query_param]).split(',') qs = qs.filter(mandates__in=Mandate.objects.filter( Q(end_date__gte=datetime.today) | Q(end_date__isnull=True)).filter( -- GitLab From 9f75dfea1c83876d05e6efdc9e7d50948b233739 Mon Sep 17 00:00:00 2001 From: okhin Date: Mon, 27 Feb 2017 12:35:22 +0100 Subject: [PATCH 2/4] Stupid typo --- src/representatives/filters.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/representatives/filters.py b/src/representatives/filters.py index aaf247d..41abc89 100644 --- a/src/representatives/filters.py +++ b/src/representatives/filters.py @@ -50,7 +50,7 @@ class ActiveConstituencyFilterBackend(BaseFilterBackend): if self.query_param in request.GET: if len(request.GET[self.query_params]): - mandates = urlunqoute(request.GET[self.query_param]).split(',') + mandates = urlunquote(request.GET[self.query_param]).split(',') qs = qs.filter(mandates__in=Mandate.objects.filter( Q(end_date__gte=datetime.today) | Q(end_date__isnull=True)).filter( -- GitLab From 47addc4c82dd1f2a77ea8703baeb4effa97b1600 Mon Sep 17 00:00:00 2001 From: okhin Date: Mon, 27 Feb 2017 12:47:19 +0100 Subject: [PATCH 3/4] Fixing the pip-cache system according to https://fleschenberg.net/gitlab-pip-cache/ --- .gitlab-ci.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a7926f7..0b54f4a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,8 +1,10 @@ -before_script: - - export PIP_CACHE_DIR="pip-cache" +variables: + PIP_CACHE_DIR = "$CI_PROJECT_DIR/pip-cache" + cache: paths: - - pip-cache + - "$CI_PROJECT_DIR/pip-cache" + key: "$CI_PROJECT_ID" job test: script: - tox -- GitLab From b34ef760c4ec6696b57804aaa7593c32174eeba3 Mon Sep 17 00:00:00 2001 From: okhin Date: Mon, 27 Feb 2017 12:50:25 +0100 Subject: [PATCH 4/4] Let's use a correct syntx for variables --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0b54f4a..fa6ec43 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,5 @@ variables: - PIP_CACHE_DIR = "$CI_PROJECT_DIR/pip-cache" + PIP_CACHE_DIR: "$CI_PROJECT_DIR/pip-cache" cache: paths: -- GitLab