Add get_extra_context method to ExtraContextMixin

This commit is contained in:
Roberto Rosario
2014-09-13 02:23:14 -04:00
parent b27d6e57be
commit bc97b6a4ef

View File

@@ -273,9 +273,12 @@ class MayanPermissionCheckMixin(object):
class ExtraContextMixin(object):
extra_context = {}
def get_extra_context(self):
return self.extra_context
def get_context_data(self, **kwargs):
context = super(ExtraContextMixin, self).get_context_data(**kwargs)
context.update(self.extra_context)
context.update(self.get_extra_context())
return context