jones-dev #19
@ -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."""
|
||||
|
Loading…
x
Reference in New Issue
Block a user