Increased Ticket.short_description length to 200

Previously 150.

I also added a check to see if 200 is exceeded before suffixing the "..." to it.
This commit is contained in:
Corban-Lee Jones 2024-01-21 22:53:00 +00:00
parent 4647236e20
commit 3f7127347b

View File

@ -106,8 +106,11 @@ class Ticket(models.Model):
def short_description(self):
"""Provide a snippet of the description for presentation purposes."""
short_description = bleach.clean(self.description, tags=[])[:150]
return f"{short_description}..."
short_description = bleach.clean(self.description, tags=[])
if len(short_description) > 200:
return f"{short_description[:200]}..."
return short_description
def save(self, *args, **kwargs):
"""Override the save method to clean the description and apply timestamps."""