From ef63a1186b2f14fa54668585b03d725273626945 Mon Sep 17 00:00:00 2001 From: Jachym Cepicky Date: Fri, 29 Mar 2019 15:17:10 +0100 Subject: [PATCH] fix markdown bug --- helpdesk/models.py | 4 ++++ helpdesk/templates/helpdesk/ticket_desc_table.html | 2 +- helpdesk/views/staff.py | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/helpdesk/models.py b/helpdesk/models.py index 73b29f06..6264cf84 100644 --- a/helpdesk/models.py +++ b/helpdesk/models.py @@ -748,6 +748,10 @@ class Ticket(models.Model): def get_markdown(self): return get_markdown(self.description) + @property + def get_resolution_markdown(self): + return get_markdown(self.resolution) + class FollowUpManager(models.Manager): diff --git a/helpdesk/templates/helpdesk/ticket_desc_table.html b/helpdesk/templates/helpdesk/ticket_desc_table.html index af619690..2725753c 100644 --- a/helpdesk/templates/helpdesk/ticket_desc_table.html +++ b/helpdesk/templates/helpdesk/ticket_desc_table.html @@ -33,7 +33,7 @@ {% trans "Resolution" %}{% ifequal ticket.get_status_display "Resolved" %} {% endifequal %} - {{ ticket.resolution|force_escape|urlizetrunc:50|linebreaksbr }} + {{ ticket.get_resolution_markdown|urlizetrunc:50|linebreaksbr }} {% endif %} {% trans "Due Date" %} diff --git a/helpdesk/views/staff.py b/helpdesk/views/staff.py index 8e956de3..e8afc01e 100644 --- a/helpdesk/views/staff.py +++ b/helpdesk/views/staff.py @@ -269,7 +269,7 @@ def followup_edit(request, ticket_id, followup_id): new_followup.user = followup.user new_followup.save() # get list of old attachments & link them to new_followup - attachments = FolllowUpAttachment.objects.filter(followup=followup) + attachments = FollowUpAttachment.objects.filter(followup=followup) for attachment in attachments: attachment.followup = new_followup attachment.save() @@ -1581,7 +1581,7 @@ def attachment_del(request, ticket_id, attachment_id): if not _is_my_ticket(request.user, ticket): raise PermissionDenied() - attachment = get_object_or_404(FolllowUpAttachment, id=attachment_id) + attachment = get_object_or_404(FollowUpAttachment, id=attachment_id) if request.method == 'POST': attachment.delete() return HttpResponseRedirect(reverse('helpdesk:view', args=[ticket_id]))