mirror of
				https://gitlab.com/animath/si/plateforme.git
				synced 2025-11-04 00:52:03 +01:00 
			
		
		
		
	Improve payment admin page
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
		@@ -96,7 +96,11 @@ class VolunteerRegistrationAdmin(PolymorphicChildModelAdmin):
 | 
			
		||||
 | 
			
		||||
@admin.register(Payment)
 | 
			
		||||
class PaymentAdmin(ModelAdmin):
 | 
			
		||||
    list_display = ('registration', 'type', 'valid', )
 | 
			
		||||
    list_display = ('registration', 'registration_type', 'type', 'valid', )
 | 
			
		||||
    search_fields = ('registration__user__last_name', 'registration__user__first_name', 'registration__user__email',)
 | 
			
		||||
    list_filter = ('type', 'valid',)
 | 
			
		||||
    list_filter = ('registration__team__participation__valid', 'type', 'type', 'valid',)
 | 
			
		||||
    autocomplete_fields = ('registration',)
 | 
			
		||||
 | 
			
		||||
    @admin.display(description=_('registration type'), ordering='registration__polymorphic_ctype')
 | 
			
		||||
    def registration_type(self, record: Payment):
 | 
			
		||||
        return record.registration.get_real_instance().type
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user