Optimises some queries on attendee profile page
This commit is contained in:
		
							parent
							
								
									ace7aa3efa
								
							
						
					
					
						commit
						62858b0f6e
					
				
					 1 changed files with 4 additions and 2 deletions
				
			
		|  | @ -454,7 +454,8 @@ def attendee(request, form, user_id=None): | ||||||
|     # Credit Notes |     # Credit Notes | ||||||
|     credit_notes = commerce.CreditNote.objects.filter( |     credit_notes = commerce.CreditNote.objects.filter( | ||||||
|         invoice__user=attendee.user, |         invoice__user=attendee.user, | ||||||
|     ) |     ).select_related("invoice", "creditnoteapplication", "creditnoterefund") | ||||||
|  | 
 | ||||||
|     reports.append(QuerysetReport( |     reports.append(QuerysetReport( | ||||||
|         "Credit Notes", |         "Credit Notes", | ||||||
|         ["id", "status", "value"], |         ["id", "status", "value"], | ||||||
|  | @ -465,7 +466,8 @@ def attendee(request, form, user_id=None): | ||||||
|     # All payments |     # All payments | ||||||
|     payments = commerce.PaymentBase.objects.filter( |     payments = commerce.PaymentBase.objects.filter( | ||||||
|         invoice__user=attendee.user, |         invoice__user=attendee.user, | ||||||
|     ) |     ).select_related("invoice") | ||||||
|  |      | ||||||
|     reports.append(QuerysetReport( |     reports.append(QuerysetReport( | ||||||
|         "Payments", |         "Payments", | ||||||
|         ["invoice__id", "id", "reference", "amount"], |         ["invoice__id", "id", "reference", "amount"], | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Christopher Neugebauer
						Christopher Neugebauer