Attendee data page is now slightly more useful
This commit is contained in:
parent
6dbc303e7c
commit
3ca2be8c4b
1 changed files with 13 additions and 4 deletions
|
@ -405,17 +405,26 @@ def attendee(request, form, user_id=None):
|
||||||
reports = []
|
reports = []
|
||||||
|
|
||||||
profile_data = []
|
profile_data = []
|
||||||
|
try:
|
||||||
profile = people.AttendeeProfileBase.objects.get_subclass(
|
profile = people.AttendeeProfileBase.objects.get_subclass(
|
||||||
attendee=attendee
|
attendee=attendee
|
||||||
)
|
)
|
||||||
|
fields = profile._meta.get_fields()
|
||||||
|
except people.AttendeeProfileBase.DoesNotExist:
|
||||||
|
fields = []
|
||||||
|
|
||||||
exclude = set(["attendeeprofilebase_ptr", "id"])
|
exclude = set(["attendeeprofilebase_ptr", "id"])
|
||||||
for field in profile._meta.get_fields():
|
for field in fields:
|
||||||
if field.name in exclude:
|
if field.name in exclude:
|
||||||
# Not actually important
|
# Not actually important
|
||||||
continue
|
continue
|
||||||
if not hasattr(field, "verbose_name"):
|
if not hasattr(field, "verbose_name"):
|
||||||
continue # Not a publicly visible field
|
continue # Not a publicly visible field
|
||||||
value = getattr(profile, field.name)
|
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))
|
profile_data.append((field.verbose_name, value))
|
||||||
|
|
||||||
cart = CartController.for_user(attendee.user)
|
cart = CartController.for_user(attendee.user)
|
||||||
|
|
Loading…
Reference in a new issue