From 66b3424fbe863f963faa6a32966cbbd1d3b52298 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Thu, 9 Jul 2015 01:24:28 -0400 Subject: [PATCH] Simplify smart settings views. --- mayan/apps/smart_settings/views.py | 36 ++++++++++-------------------- 1 file changed, 12 insertions(+), 24 deletions(-) diff --git a/mayan/apps/smart_settings/views.py b/mayan/apps/smart_settings/views.py index 13e03d1b32..d575e1db1e 100644 --- a/mayan/apps/smart_settings/views.py +++ b/mayan/apps/smart_settings/views.py @@ -10,34 +10,22 @@ from .classes import Namespace class NamespaceListView(SimpleView): template_name = 'appearance/generic_list.html' - def get_context_data(self, **kwargs): - context = super(NamespaceListView, self).get_context_data(**kwargs) - - context.update( - { - 'hide_link': True, - 'object_list': Namespace.get_all(), - 'title': _('Setting namespaces'), - } - ) - - return context + def get_extra_context(self): + return { + 'hide_link': True, + 'object_list': Namespace.get_all(), + 'title': _('Setting namespaces'), + } class NamespaceDetailView(SimpleView): template_name = 'appearance/generic_list.html' - def get_context_data(self, **kwargs): - context = super(NamespaceDetailView, self).get_context_data(**kwargs) - + def get_extra_context(self): namespace = Namespace.get(self.kwargs['namespace_name']) - context.update( - { - 'hide_object': True, - 'object_list': namespace.settings, - 'title': _('Settings in namespace: %s') % namespace, - } - ) - - return context + return { + 'hide_object': True, + 'object_list': namespace.settings, + 'title': _('Settings in namespace: %s') % namespace, + }