From dd6e418814ace2c5e694bd0b2a3c85cc91879b94 Mon Sep 17 00:00:00 2001 From: Shgck Date: Sat, 2 May 2015 14:43:10 +0200 Subject: [PATCH] Use "lower" template filter instead of duplicate values --- label/templates/label/artist.html | 2 +- label/templates/label/releases.html | 2 +- label/views.py | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/label/templates/label/artist.html b/label/templates/label/artist.html index 7a221d2..a4cadca 100644 --- a/label/templates/label/artist.html +++ b/label/templates/label/artist.html @@ -72,7 +72,7 @@ {{ release.year }} - {{ release.title }} + {{ release.title }} {% if release.release_type == 1 %}(EP){% endif %} {% if release.release_type == 2 %}(Split){% endif %} {% if release.release_type == 3 %}(Demo){% endif %} diff --git a/label/templates/label/releases.html b/label/templates/label/releases.html index e20c8df..1188212 100644 --- a/label/templates/label/releases.html +++ b/label/templates/label/releases.html @@ -24,7 +24,7 @@ - {{ release.title }} + {{ release.title }} {% if release.release_type == 1 %}(EP){% endif %} {% if release.release_type == 2 %}(Split){% endif %} {% if release.release_type == 3 %}(Demo){% endif %} diff --git a/label/views.py b/label/views.py index 6a3328a..3e6c9bb 100644 --- a/label/views.py +++ b/label/views.py @@ -17,6 +17,8 @@ def artists(request): def artist(request, slug): artist = get_object_or_404(Artist, slug = slug) releases = artist.release_set.all() + for release in releases: + release.tag = tools.get_catalog_tag_from_id(release.ident) context = { "artist": artist, "releases": releases } return render(request, "label/artist.html", context) @@ -32,7 +34,6 @@ def releases(request): "id": release.id, "release_type": release.release_type, "tag": release_tag, - "tag_lower": release_tag.lower(), "title": release.title, "contribs": tools.get_contribs(release.contributors.all()), "year": release.year