diff options
| author | Mike Korobov | 2009-07-23 16:48:41 +0800 | 
|---|---|---|
| committer | Rob Hudson | 2009-07-28 22:43:00 +0800 | 
| commit | 658c7384112cc45ec04343b03ce7f670b012ab0e (patch) | |
| tree | e0a18febcf03eec2a4f317b1b064dd80805670e1 /debug_toolbar/panels/template.py | |
| parent | 4dc0710b6a5eedec0448909f6b90e55a4f3555d4 (diff) | |
| download | django-debug-toolbar-658c7384112cc45ec04343b03ce7f670b012ab0e.tar.bz2 | |
Bypass context variables which 'repr' is broken.
Signed-off-by: Rob Hudson <rob@tastybrew.com>
Diffstat (limited to 'debug_toolbar/panels/template.py')
| -rw-r--r-- | debug_toolbar/panels/template.py | 9 | 
1 files changed, 8 insertions, 1 deletions
| diff --git a/debug_toolbar/panels/template.py b/debug_toolbar/panels/template.py index 7dc7b06..b548287 100644 --- a/debug_toolbar/panels/template.py +++ b/debug_toolbar/panels/template.py @@ -72,7 +72,14 @@ class TemplateDebugPanel(DebugPanel):              info['template'] = t              # Clean up context for better readability              c = d.get('context', None) -            info['context'] = '\n'.join([pformat(_d) for _d in c.dicts]) +             +            d_list = [] +            for _d in c.dicts: +                try: +                    d_list.append(pformat(d)) +                except UnicodeEncodeError: +                    pass +            info['context'] = '\n'.join(d_list)              template_context.append(info)          context = {              'templates': template_context, | 
