From ab74e95c41fdcaf078b2486ffc4427e296b05793 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 21 Aug 2018 12:23:09 +0000 Subject: [PATCH] more cleanups --- content/templates/base.html | 2 +- content/views.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/content/templates/base.html b/content/templates/base.html index 5407a0b..73f7ac5 100644 --- a/content/templates/base.html +++ b/content/templates/base.html @@ -24,7 +24,7 @@
  • ABOUT
  • {% available_content as sections %} {% for url, title in sections %} -
  • {{title}}
  • +
  • {{title}}
  • {% endfor %}
  • CONTACT
  • diff --git a/content/views.py b/content/views.py index c1498fb..b20d59e 100644 --- a/content/views.py +++ b/content/views.py @@ -135,6 +135,7 @@ def render_content(request, shortname, section, template, types): return event(request) else: return section_index(request, section) + shortname = shortname.replace(' ', '_') content = get_object_or_404(Content, shortname=shortname, type__name__in=types) if not content.published and not request.user.is_staff: raise Http404 @@ -242,9 +243,9 @@ def redirect_index(request): return redirect(reverse('index')) def redirect_event(request): - shortname = request.GET.get('this') + shortname = request.GET.get('this').replace(' ', '_').lower() if shortname: - content = get_object_or_404(Content, shortname=shortname) + content = get_object_or_404(Content, shortname__iexact=shortname) return redirect(content.get_absolute_url()) id = request.GET.get('id') if id: