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 = [] | ||||
| 
 | ||||
|     profile_data = [] | ||||
|     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) | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Christopher Neugebauer
						Christopher Neugebauer