fix markdown bug

This commit is contained in:
Jachym Cepicky 2019-03-29 15:17:10 +01:00
parent eb60b967c8
commit ef63a1186b
3 changed files with 7 additions and 3 deletions

View File

@ -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):

View File

@ -33,7 +33,7 @@
<th colspan='2'>{% trans "Resolution" %}{% ifequal ticket.get_status_display "Resolved" %} <a href='?close'><button type="button" class="btn btn-warning btn-sm">{% trans "Accept and Close" %}</button></a>{% endifequal %}</th>
</tr>
<tr>
<td colspan='2'>{{ ticket.resolution|force_escape|urlizetrunc:50|linebreaksbr }}</td>
<td colspan='2'>{{ ticket.get_resolution_markdown|urlizetrunc:50|linebreaksbr }}</td>
</tr>{% endif %}
<tr>
<th>{% trans "Due Date" %}</th>

View File

@ -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]))