From a2e9c575030e28e05b2e3a34765fdd600665a31e Mon Sep 17 00:00:00 2001 From: Shgck Date: Sat, 2 May 2015 15:16:55 +0200 Subject: [PATCH] Markdown description (I thought that was fixed ??) --- label/templates/label/artist.html | 4 +++- label/views.py | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/label/templates/label/artist.html b/label/templates/label/artist.html index a4cadca..a5b626c 100644 --- a/label/templates/label/artist.html +++ b/label/templates/label/artist.html @@ -55,7 +55,9 @@ {% if artist.description %} -

{{ artist.description }}

+ {% autoescape off %} + {{ artist.description }} + {% endautoescape %} {% endif %} diff --git a/label/views.py b/label/views.py index 3e6c9bb..c83fc59 100644 --- a/label/views.py +++ b/label/views.py @@ -1,3 +1,5 @@ +import markdown + from django.shortcuts import get_object_or_404, render from label.models import Artist, Release @@ -16,9 +18,12 @@ def artists(request): def artist(request, slug): artist = get_object_or_404(Artist, slug = slug) + artist.description = markdown.markdown(artist.description) + 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)