|  | @@ -1,4 +1,3 @@
 | 
											
												
													
														|  | -from django.template import Context
 |  | 
 | 
											
												
													
														|  |  from importlib import import_module
 |  |  from importlib import import_module
 | 
											
												
													
														|  |  from django.core.urlresolvers import reverse
 |  |  from django.core.urlresolvers import reverse
 | 
											
												
													
														|  |  from django.template.loader import render_to_string
 |  |  from django.template.loader import render_to_string
 | 
											
										
											
												
													
														|  | @@ -6,7 +5,8 @@ from jet.dashboard import modules
 | 
											
												
													
														|  |  from jet.dashboard.models import UserDashboardModule
 |  |  from jet.dashboard.models import UserDashboardModule
 | 
											
												
													
														|  |  from django.utils.translation import ugettext_lazy as _
 |  |  from django.utils.translation import ugettext_lazy as _
 | 
											
												
													
														|  |  from jet.ordered_set import OrderedSet
 |  |  from jet.ordered_set import OrderedSet
 | 
											
												
													
														|  | -from jet.utils import get_admin_site_name
 |  | 
 | 
											
												
													
														|  | 
 |  | +from jet.utils import get_admin_site_name, context_to_dict
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |  try:
 |  |  try:
 | 
											
												
													
														|  |      from django.template.context_processors import csrf
 |  |      from django.template.context_processors import csrf
 | 
											
												
													
														|  |  except ImportError:
 |  |  except ImportError:
 | 
											
										
											
												
													
														|  | @@ -48,12 +48,6 @@ class Dashboard(object):
 | 
											
												
													
														|  |          self.set_context(context)
 |  |          self.set_context(context)
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |      def set_context(self, context):
 |  |      def set_context(self, context):
 | 
											
												
													
														|  | -        if isinstance(context, Context):
 |  | 
 | 
											
												
													
														|  | -            flat = {}
 |  | 
 | 
											
												
													
														|  | -            for d in context.dicts:
 |  | 
 | 
											
												
													
														|  | -                flat.update(d)
 |  | 
 | 
											
												
													
														|  | -            context = flat
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  |          self.context = context
 |  |          self.context = context
 | 
											
												
													
														|  |          self.init_with_context(context)
 |  |          self.init_with_context(context)
 | 
											
												
													
														|  |          self.load_modules()
 |  |          self.load_modules()
 | 
											
										
											
												
													
														|  | @@ -153,7 +147,7 @@ class Dashboard(object):
 | 
											
												
													
														|  |          self.modules = loaded_modules
 |  |          self.modules = loaded_modules
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |      def render(self):
 |  |      def render(self):
 | 
											
												
													
														|  | -        context = self.context
 |  | 
 | 
											
												
													
														|  | 
 |  | +        context = context_to_dict(self.context)
 | 
											
												
													
														|  |          context.update({
 |  |          context.update({
 | 
											
												
													
														|  |              'columns': range(self.columns),
 |  |              'columns': range(self.columns),
 | 
											
												
													
														|  |              'modules': self.modules,
 |  |              'modules': self.modules,
 | 
											
										
											
												
													
														|  | @@ -164,7 +158,7 @@ class Dashboard(object):
 | 
											
												
													
														|  |          return render_to_string('jet.dashboard/dashboard.html', context)
 |  |          return render_to_string('jet.dashboard/dashboard.html', context)
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |      def render_tools(self):
 |  |      def render_tools(self):
 | 
											
												
													
														|  | -        context = self.context
 |  | 
 | 
											
												
													
														|  | 
 |  | +        context = context_to_dict(self.context)
 | 
											
												
													
														|  |          context.update({
 |  |          context.update({
 | 
											
												
													
														|  |              'children': self.children,
 |  |              'children': self.children,
 | 
											
												
													
														|  |              'app_label': self.app_label,
 |  |              'app_label': self.app_label,
 |