emile 1 year ago
parent e77ce16f32
commit 2d63528c1d

Binary file not shown.

@ -677,15 +677,11 @@ def add_ticket(request, customer_id):
file_paths = request.POST.getlist('filePath') file_paths = request.POST.getlist('filePath')
for file_path in file_paths: for file_path in file_paths:
if os.path.exists(file_path): ticket_attachment = TicketAttachment(
with open(file_path, 'rb') as f: ticket=ticket,
ticket_attachment = TicketAttachment( file_path=file_path
ticket=ticket, )
file_path=file_path ticket_attachment.save()
)
ticket_attachment.save()
else:
print("Error: File does not exist at the provided path:", file_path)
return redirect('ticketdetails', ticket_number=ticket.ticket_number) return redirect('ticketdetails', ticket_number=ticket.ticket_number)

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

@ -54,7 +54,7 @@ class FileUpload {
console.log('File uploaded to:', res.existingPath); console.log('File uploaded to:', res.existingPath);
// Add the uploaded file path as an option in the select tag // Add the uploaded file path as an option in the select tag
var option = '<option value="' + res.existingPath + '">' + res.existingPath + '</option>'; var option = '<option value="' + res.existingPath + '" selected>' + res.existingPath + '</option>';
$('#filePathInput').append(option); $('#filePathInput').append(option);
} }
}); });

Loading…
Cancel
Save