From 1e0882978d5d466478b62d6aeb27556da4958b77 Mon Sep 17 00:00:00 2001 From: Iurii Kriachko Date: Sun, 15 Jan 2012 13:47:49 +0200 Subject: [PATCH] Update mockups/management/commands/mockups.py --- mockups/management/commands/mockups.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/mockups/management/commands/mockups.py b/mockups/management/commands/mockups.py index 33d25bd..4ec20f9 100644 --- a/mockups/management/commands/mockups.py +++ b/mockups/management/commands/mockups.py @@ -78,9 +78,12 @@ class Command(BaseCommand): ) def format_output(self, obj): - output = unicode(obj) - if len(output) > 50: - output = u'%s ...' % output[:50] + try: + output = unicode(obj) + if len(output) > 50: + output = u'%s ...' % output[:50] + except UnicodeDecodeError: + output = '' return output def print_instance(self, sender, model, instance, **kwargs):