more cleanups

This commit is contained in:
root 2018-08-21 12:23:09 +00:00
parent ab7a4d3b99
commit ab74e95c41
2 changed files with 4 additions and 3 deletions

View File

@ -24,7 +24,7 @@
<li><a href="/about">ABOUT</a></li>
{% available_content as sections %}
{% for url, title in sections %}
<li><a href="{{url}}">{{title}}</a></li>
<li><a href="{{url}}index/">{{title}}</a></li>
{% endfor %}
<li><a href="/contact">CONTACT</a></li>
</ul>

View File

@ -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: