Files
bugsink/sentry/utils/strings.py
Klaas van Schelven fc7e186918 getting hash for issue: use GlitchTip's approach as an early stand-in
af9a700a8706f20771b005804d8c92ca95c8b072 in GlitchTip
2023-11-04 22:14:39 +01:00

13 lines
289 B
Python

from django.utils.encoding import smart_str
def truncatechars(value: str, chars=100):
"""Truncate string and append …"""
return (value[:chars] + "") if len(value) > chars else value
def strip(value):
if not value:
return ""
return smart_str(value).strip()