mirror of
https://github.com/bugsink/bugsink.git
synced 2025-12-20 12:29:57 -06:00
truncatechars: just use the Django version
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
from sentry.utils.safe import get_path
|
||||
from sentry.utils.strings import strip, truncatechars
|
||||
from sentry.utils.strings import strip
|
||||
from django.template.defaultfilters import truncatechars
|
||||
|
||||
|
||||
class DefaultEvent:
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
from django.template.defaultfilters import truncatechars
|
||||
|
||||
from sentry.stacktraces.functions import get_function_name_for_frame
|
||||
from sentry.stacktraces.processing import get_crash_frame_from_event_data
|
||||
from sentry.utils.safe import get_path, trim, truncatechars
|
||||
from sentry.utils.safe import get_path, trim
|
||||
|
||||
|
||||
def get_crash_location(data):
|
||||
|
||||
@@ -2,8 +2,8 @@ import collections
|
||||
import json
|
||||
|
||||
from django.utils.encoding import force_str
|
||||
from django.template.defaultfilters import truncatechars
|
||||
|
||||
from sentry.utils.strings import truncatechars
|
||||
|
||||
SENTRY_MAX_VARIABLE_SIZE = 512
|
||||
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
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 ""
|
||||
|
||||
Reference in New Issue
Block a user