@@ -83,19 +83,20 @@ def content(self):
83
83
84
84
context_list = []
85
85
for context_layer in context_data .dicts :
86
- for key , value in context_layer .items ():
87
- # Replace any request elements - they have a large
88
- # unicode representation and the request data is
89
- # already made available from the Request Vars panel.
90
- if isinstance (value , http .HttpRequest ):
91
- context_layer [key ] = '<<request>>'
92
- # Replace the debugging sql_queries element. The SQL
93
- # data is already made available from the SQL panel.
94
- elif key == 'sql_queries' and isinstance (value , list ):
95
- context_layer [key ] = '<<sql_queries>>'
96
- # Replace LANGUAGES, which is available in i18n context processor
97
- elif key == 'LANGUAGES' and isinstance (value , tuple ):
98
- context_layer [key ] = '<<languages>>'
86
+ if hasattr (context_layer , 'items' ):
87
+ for key , value in context_layer .items ():
88
+ # Replace any request elements - they have a large
89
+ # unicode representation and the request data is
90
+ # already made available from the Request Vars panel.
91
+ if isinstance (value , http .HttpRequest ):
92
+ context_layer [key ] = '<<request>>'
93
+ # Replace the debugging sql_queries element. The SQL
94
+ # data is already made available from the SQL panel.
95
+ elif key == 'sql_queries' and isinstance (value , list ):
96
+ context_layer [key ] = '<<sql_queries>>'
97
+ # Replace LANGUAGES, which is available in i18n context processor
98
+ elif key == 'LANGUAGES' and isinstance (value , tuple ):
99
+ context_layer [key ] = '<<languages>>'
99
100
try :
100
101
context_list .append (pformat (context_layer ))
101
102
except UnicodeEncodeError :
0 commit comments