From 3d9ee2aa227ef7da292ce12ed659a171ca99b541 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Wed, 4 Apr 2018 17:32:18 +0200 Subject: [PATCH] added ascii utf filter to messages around comments --- rowers/views.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rowers/views.py b/rowers/views.py index 6d2da7c3..ef5f6f6e 100644 --- a/rowers/views.py +++ b/rowers/views.py @@ -8564,6 +8564,11 @@ def workout_comment_view(request,id=0): cd = form.cleaned_data comment = cd['comment'] comment = bleach.clean(comment) + if isinstance(comment,unicode): + comment = comment.encode('utf8') + elif isinstance(comment, str): + comment = comment.decode('utf8') + notification = cd['notification'] c = WorkoutComment(workout=w,user=request.user,comment=comment, notification=notification)