Skip to content

Commit

Permalink
Merge pull request getsentry#177 from talkatv/master
Browse files Browse the repository at this point in the history
Make shorten() use serializers's transform()
  • Loading branch information
dcramer committed Sep 8, 2012
2 parents 0541383 + 8bc5054 commit 80ee302
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion raven/utils/encoding.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ def force_unicode(s, encoding='utf-8', errors='strict'):

def transform(value):
from raven.utils.serializer import transform

warnings.warn('You should switch to raven.utils.serializer.transform', DeprecationWarning)

return transform(value)
Expand All @@ -82,6 +81,8 @@ def to_string(value):


def shorten(var, list_length=50, string_length=200):
from raven.utils.serializer import transform

var = transform(var)
if isinstance(var, basestring) and len(var) > string_length:
var = var[:string_length] + '...'
Expand Down

0 comments on commit 80ee302

Please sign in to comment.