mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-06-21 12:38:26 +02: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
|
||||
|
@ -370,7 +370,7 @@ class Payment(models.Model):
|
||||
)
|
||||
|
||||
valid = models.BooleanField(
|
||||
verbose_name=_("valid"),
|
||||
verbose_name=_("payment valid"),
|
||||
null=True,
|
||||
default=False,
|
||||
)
|
||||
|
Reference in New Issue
Block a user