From 3ca2be8c4b1cd09481ae654e541865213638b118 Mon Sep 17 00:00:00 2001 From: Christopher Neugebauer Date: Thu, 6 Oct 2016 12:49:37 -0700 Subject: [PATCH] Attendee data page is now slightly more useful --- registrasion/reporting/views.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/registrasion/reporting/views.py b/registrasion/reporting/views.py index 2c1c8a86..c29d8cb9 100644 --- a/registrasion/reporting/views.py +++ b/registrasion/reporting/views.py @@ -405,17 +405,26 @@ def attendee(request, form, user_id=None): reports = [] profile_data = [] - profile = people.AttendeeProfileBase.objects.get_subclass( - attendee=attendee - ) + try: + profile = people.AttendeeProfileBase.objects.get_subclass( + attendee=attendee + ) + fields = profile._meta.get_fields() + except people.AttendeeProfileBase.DoesNotExist: + fields = [] + exclude = set(["attendeeprofilebase_ptr", "id"]) - for field in profile._meta.get_fields(): + for field in fields: if field.name in exclude: # Not actually important continue if not hasattr(field, "verbose_name"): continue # Not a publicly visible field value = getattr(profile, field.name) + + if isinstance(field, models.ManyToManyField): + value = ", ".join(str(i) for i in value.all()) + profile_data.append((field.verbose_name, value)) cart = CartController.for_user(attendee.user)