Add attachment validator when uploading attachment to tickets

This commit is contained in:
Garret Wassermann
2021-10-05 06:25:42 -04:00
parent a5f801bb52
commit aff67184d4
10 changed files with 81 additions and 4 deletions

View File

@ -30,6 +30,8 @@ import uuid
from helpdesk import settings as helpdesk_settings
from .validators import validate_file_extension
from .templated_email import send_templated_mail
@ -1022,6 +1024,7 @@ class Attachment(models.Model):
_('File'),
upload_to=attachment_path,
max_length=1000,
validators=[validate_file_extension]
)
filename = models.CharField(