From 5511a3d00a77869b007a519f01dc5c51b3750700 Mon Sep 17 00:00:00 2001 From: Sachi King Date: Sun, 17 Dec 2017 15:39:31 +1100 Subject: [PATCH] str values before bleach Can't operate on objects, stringing seems fine here, there's a lot else already randomly str() before bleach. --- vendor/registrasion/registrasion/reporting/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vendor/registrasion/registrasion/reporting/views.py b/vendor/registrasion/registrasion/reporting/views.py index 21f03a16..9820ec8f 100644 --- a/vendor/registrasion/registrasion/reporting/views.py +++ b/vendor/registrasion/registrasion/reporting/views.py @@ -573,7 +573,7 @@ def attendee(request, form, user_id=None): value = ", ".join(str(i) for i in value.all()) elif isinstance(field, CharField): try: - value = bleach.clean(value) + value = bleach.clean(str(value)) except TypeError: value = "Bad value for %s" % field.name @@ -864,7 +864,7 @@ def attendee_data(request, form, user_id=None): return [str(i) for i in attr.all()] or "" else: try: - return bleach.clean(attr) + return bleach.clean(str(attr)) except TypeError: return "Bad value found for %s" % attr