Allow markdown rendering in transaction comments. (#621)

This commit allows transaction comments to display newlines and URLs in
a useful way, helping when additional data (such as a reference to a
ticket system or a longer discussion) is required.
This PR also prevents pretix from having to bring its own chat system ;)
This commit is contained in:
Tobias Kunze
2017-09-25 11:25:32 +02:00
committed by Raphael Michel
parent f40950efc9
commit 244b767f8f
3 changed files with 16 additions and 8 deletions

View File

@@ -106,10 +106,13 @@ class ActionView(View):
return self._retry(trans)
def _comment(self, trans, comment):
from pretix.base.templatetags.rich_text import rich_text
trans.comment = comment
trans.save()
return JsonResponse({
'status': 'ok'
'status': 'ok',
'comment': rich_text(comment),
'plain': comment,
})
def post(self, request, *args, **kwargs):