functional filter + add modal

This commit is contained in:
2024-01-10 23:15:43 +00:00
parent 4c7a81e076
commit 690bec9b24
3 changed files with 113 additions and 14 deletions

View File

@ -101,14 +101,23 @@ class Ticket(models.Model):
def clean_description(self):
cleaned_description = bleach.clean(
self.description,
tags=['b', 'i', 'u', 'p', 'br', 'a', 'h3', 'h4', 'h5', 'h6'],
tags=[
'b', 'i', 'u', 'p', 'br', 'a', 'h3', 'h4', 'h5', 'h6', 'strong',
'figure', 'table', 'tbody', 'tr', 'td'
],
attributes={'a': ['href', 'title']}
)
return cleaned_description
def save(self, *args, **kwargs):
self.description = self.clean_description()
# self.edit_timestamp = timezone.now() ## TEMP COMMENT, UNCOMMENT LATER !!
# we must use the same datetime object, otherwise they wont match
now = timezone.now()
if self._state.adding: self.create_timestamp = now
self.edit_timestamp = now
super().save(*args, **kwargs)
@property