Backport #980, #981, #984 to 0.3

This commit is contained in:
Garret Wassermann 2021-11-19 00:30:20 -05:00
parent e016e6699d
commit 44abb19712
3 changed files with 9 additions and 4 deletions

View File

@ -145,6 +145,7 @@ def process_attachments(followup, attached_files):
'application/octet-stream', 'application/octet-stream',
size=attached.size, size=attached.size,
) )
att.full_clean()
att.save() att.save()
if attached.size < max_email_attachment_size: if attached.size < max_email_attachment_size:

View File

@ -1,8 +1,8 @@
from celery.decorators import task from celery import shared_task
from .email import process_email from .email import process_email
@task() @shared_task
def helpdesk_process_email(): def helpdesk_process_email():
process_email() process_email()

View File

@ -330,7 +330,11 @@
function get_url(row) { function get_url(row) {
return "{% url 'helpdesk:view' 1234 %}".replace(/1234/, row.id.toString()); return "{% url 'helpdesk:view' 1234 %}".replace(/1234/, row.id.toString());
} }
function htmlEntities(str) {
return String(str).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
}
$(document).ready(function () { $(document).ready(function () {
// Ticket DataTable Initialization // Ticket DataTable Initialization
$('#ticketTable').DataTable({ $('#ticketTable').DataTable({
@ -366,7 +370,7 @@
if (type === 'display') { if (type === 'display') {
data = '<div class="tickettitle"><a href="' + get_url(row) + '" >' + data = '<div class="tickettitle"><a href="' + get_url(row) + '" >' +
row.id + '. ' + row.id + '. ' +
row.title + '</a></div>'; htmlEntities(row.title) + '</a></div>';
} }
return data return data
} }