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