From 3f84b8d839dce8f21c7b45c282c0a4b88b614eb9 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Wed, 12 Aug 2015 01:45:11 -0400 Subject: [PATCH] Raise HTTP error 404 on invalid setting namespaces. --- mayan/apps/smart_settings/views.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mayan/apps/smart_settings/views.py b/mayan/apps/smart_settings/views.py index d575e1db1e..7465345ee6 100644 --- a/mayan/apps/smart_settings/views.py +++ b/mayan/apps/smart_settings/views.py @@ -1,5 +1,6 @@ from __future__ import unicode_literals +from django.http import Http404 from django.utils.translation import ugettext_lazy as _ from common.views import SimpleView @@ -22,7 +23,10 @@ class NamespaceDetailView(SimpleView): template_name = 'appearance/generic_list.html' def get_extra_context(self): - namespace = Namespace.get(self.kwargs['namespace_name']) + try: + namespace = Namespace.get(self.kwargs['namespace_name']) + except KeyError: + raise Http404(_('Namespace: %s, not found') % self.kwargs['namespace_name']) return { 'hide_object': True,