From 887373c006ebb982376921d371ea34f5b69f439f Mon Sep 17 00:00:00 2001 From: Eliot Berriot Date: Thu, 24 Jan 2019 11:04:29 +0100 Subject: [PATCH 1/3] Fixed a docker build issue with pip 19 --- api/Dockerfile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/api/Dockerfile b/api/Dockerfile index 92a4d7f49..c735ab397 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -25,15 +25,18 @@ RUN \ RUN mkdir /requirements COPY ./requirements/base.txt /requirements/base.txt +# hack around https://github.com/pypa/pip/issues/6158#issuecomment-456619072 +ENV PIP_DOWNLOAD_CACHE=/noop/ RUN \ echo 'fixing requirements file for alpine' && \ sed -i '/Pillow/d' /requirements/base.txt && \ \ \ echo 'installing pip requirements' && \ - pip3 install --no-cache-dir --upgrade pip && \ - pip3 install --no-cache-dir setuptools wheel && \ - pip3 install --no-cache-dir -r /requirements/base.txt + pip3 install --upgrade pip && \ + pip3 install setuptools wheel && \ + pip3 install -r /requirements/base.txt && \ + rm -rf $PIP_DOWNLOAD_CACHE ARG install_dev_deps=0 COPY ./requirements/*.txt /requirements/ From 51dbd905e77c3e240f71a227136402dd7c380a3b Mon Sep 17 00:00:00 2001 From: Eliot Berriot Date: Thu, 24 Jan 2019 11:06:11 +0100 Subject: [PATCH 2/3] Fix #666: crashing Django admin when loading track detail page --- api/requirements/base.txt | 2 +- changes/changelog.d/666.bugfix | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changes/changelog.d/666.bugfix diff --git a/api/requirements/base.txt b/api/requirements/base.txt index d004a7044..e770b3882 100644 --- a/api/requirements/base.txt +++ b/api/requirements/base.txt @@ -42,7 +42,7 @@ ipython>=6,<7 mutagen>=1.42,<1.43 -django-taggit>=0.22,<0.23 +django-taggit>=0.23,<0.24 pymemoize==1.0.3 django-dynamic-preferences>=1.7,<1.8 diff --git a/changes/changelog.d/666.bugfix b/changes/changelog.d/666.bugfix new file mode 100644 index 000000000..5027dd403 --- /dev/null +++ b/changes/changelog.d/666.bugfix @@ -0,0 +1 @@ +Fixed crashing Django admin when loading track detail page (#666) From 3b87580a696a615415555896c15be36bf710ffab Mon Sep 17 00:00:00 2001 From: Eliot Berriot Date: Thu, 24 Jan 2019 11:06:37 +0100 Subject: [PATCH 3/3] Reduced number of SQL queries when loading /api/admin/music/tracks/ --- api/funkwhale_api/music/admin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/funkwhale_api/music/admin.py b/api/funkwhale_api/music/admin.py index fca544cc8..b2f001527 100644 --- a/api/funkwhale_api/music/admin.py +++ b/api/funkwhale_api/music/admin.py @@ -20,7 +20,7 @@ class AlbumAdmin(admin.ModelAdmin): class TrackAdmin(admin.ModelAdmin): list_display = ["title", "artist", "album", "mbid"] search_fields = ["title", "artist__name", "album__title", "mbid"] - list_select_related = True + list_select_related = ["album__artist", "artist"] @admin.register(models.ImportBatch)