From f65dfa330c3a628f001fab07052a54a7052e2c36 Mon Sep 17 00:00:00 2001 From: Fabian Weisshaar Date: Sun, 27 Dec 2015 17:53:41 +0100 Subject: [PATCH] fixes #222 --- nsupdate/main/views.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nsupdate/main/views.py b/nsupdate/main/views.py index 613255c..921ebd9 100644 --- a/nsupdate/main/views.py +++ b/nsupdate/main/views.py @@ -18,6 +18,7 @@ from django.contrib import messages from django.utils.decorators import method_decorator from django.core.urlresolvers import reverse from django.http import Http404 +from django import template from django.utils.timezone import now from . import dnstools @@ -87,7 +88,11 @@ class CustomTemplateView(TemplateView): def dispatch(self, *args, **kwargs): self.template_name = 'main/custom/%s' % kwargs.get('template') - return super(CustomTemplateView, self).dispatch(*args, **kwargs) + try: + template.loader.select_template(self.template_name) + return super(CustomTemplateView, self).dispatch(*args, **kwargs) + except template.TemplateDoesNotExist: + raise Http404 class HomeView(TemplateView):