mirror of
https://github.com/bugsink/bugsink.git
synced 2026-05-19 06:38:58 -05:00
fc7e186918
af9a700a8706f20771b005804d8c92ca95c8b072 in GlitchTip
13 lines
289 B
Python
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()
|