diff --git a/vendor/registrasion/registrasion/reporting/views.py b/vendor/registrasion/registrasion/reporting/views.py index 8c38351a..21f03a16 100644 --- a/vendor/registrasion/registrasion/reporting/views.py +++ b/vendor/registrasion/registrasion/reporting/views.py @@ -572,7 +572,10 @@ def attendee(request, form, user_id=None): if isinstance(field, models.ManyToManyField): value = ", ".join(str(i) for i in value.all()) elif isinstance(field, CharField): - value = bleach.clean(value) + try: + value = bleach.clean(value) + except TypeError: + value = "Bad value for %s" % field.name profile_data.append((field.verbose_name, value)) @@ -813,7 +816,7 @@ def attendee_data(request, form, user_id=None): return None else: def display_field(value): - return bleach.clean(value) + return bleach.clean(str(value)) status_count = lambda status: Case(When( # noqa attendee__user__cart__status=status, @@ -860,7 +863,10 @@ def attendee_data(request, form, user_id=None): if isinstance(field_type, models.ManyToManyField): return [str(i) for i in attr.all()] or "" else: - return bleach.clean(attr) + try: + return bleach.clean(attr) + except TypeError: + return "Bad value found for %s" % attr headings = ["User ID", "Name", "Email", "Product", "Item Status"] headings.extend(field_names)