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:
parent
4647236e20
commit
3f7127347b
@ -106,8 +106,11 @@ class Ticket(models.Model):
|
|||||||
def short_description(self):
|
def short_description(self):
|
||||||
"""Provide a snippet of the description for presentation purposes."""
|
"""Provide a snippet of the description for presentation purposes."""
|
||||||
|
|
||||||
short_description = bleach.clean(self.description, tags=[])[:150]
|
short_description = bleach.clean(self.description, tags=[])
|
||||||
return f"{short_description}..."
|
if len(short_description) > 200:
|
||||||
|
return f"{short_description[:200]}..."
|
||||||
|
|
||||||
|
return short_description
|
||||||
|
|
||||||
def save(self, *args, **kwargs):
|
def save(self, *args, **kwargs):
|
||||||
"""Override the save method to clean the description and apply timestamps."""
|
"""Override the save method to clean the description and apply timestamps."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user