str values before bleach

Can't operate on objects, stringing seems fine here, there's a lot else
already randomly str() before bleach.
This commit is contained in:
Sachi King 2017-12-17 15:39:31 +11:00
parent 66224d6834
commit 5511a3d00a

View file

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