From 16c43769413abd3fa6cc4cada3b9b59e0e296d9d Mon Sep 17 00:00:00 2001 From: Emmy D'Anello Date: Wed, 5 Apr 2023 10:44:27 +0200 Subject: [PATCH] Improve payment admin page Signed-off-by: Emmy D'Anello --- locale/fr/LC_MESSAGES/django.po | 23 ++++++++++++++++++----- participation/models.py | 2 +- registration/admin.py | 8 ++++++-- registration/models.py | 2 +- 4 files changed, 26 insertions(+), 9 deletions(-) diff --git a/locale/fr/LC_MESSAGES/django.po b/locale/fr/LC_MESSAGES/django.po index d30fc0b..f7b5d1a 100644 --- a/locale/fr/LC_MESSAGES/django.po +++ b/locale/fr/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: TFJM\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-04 19:54+0200\n" +"POT-Creation-Date: 2023-04-05 10:43+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Emmy D'Anello \n" "Language-Team: LANGUAGE \n" @@ -228,7 +228,8 @@ msgstr "numéro de passage" #: draw/models.py:431 msgid "" "The passage order in the pool, between 0 and the size of the pool minus 1." -msgstr "L'ordre de passage dans la poule, de 0 à la taille de la poule moins 1." +msgstr "" +"L'ordre de passage dans la poule, de 0 à la taille de la poule moins 1." #: draw/models.py:439 msgid "choose index" @@ -237,7 +238,8 @@ msgstr "numéro de choix" #: draw/models.py:440 msgid "" "The choice order in the pool, between 0 and the size of the pool minus 1." -msgstr "L'ordre de choix dans la poule, entre 0 et la taille de la poule moins 1." +msgstr "" +"L'ordre de choix dans la poule, entre 0 et la taille de la poule moins 1." #: draw/models.py:446 draw/models.py:469 participation/models.py:438 #: participation/models.py:592 @@ -393,8 +395,7 @@ msgstr "changelogs" msgid "Changelog of type \"{action}\" for model {model} at {timestamp}" msgstr "Changelog de type \"{action}\" pour le modèle {model} le {timestamp}" -#: participation/admin.py:20 participation/models.py:326 -#: participation/tables.py:43 registration/models.py:373 +#: participation/admin.py:20 participation/tables.py:43 msgid "valid" msgstr "valide" @@ -597,6 +598,10 @@ msgstr "finale" msgid "tournaments" msgstr "tournois" +#: participation/models.py:326 +msgid "valid team" +msgstr "équipe valide" + #: participation/models.py:327 msgid "The participation got the validation of the organizers." msgstr "La participation a été validée par les organisateur⋅rices." @@ -1481,6 +1486,10 @@ msgstr "prénom" msgid "last name" msgstr "nom de famille" +#: registration/admin.py:104 +msgid "registration type" +msgstr "type d'inscription" + #: registration/forms.py:22 msgid "role" msgstr "rôle" @@ -1722,6 +1731,10 @@ msgstr "informations additionnelles" msgid "To help us to find your payment." msgstr "Pour nous aider à retrouver votre paiement, si nécessaire." +#: registration/models.py:373 +msgid "payment valid" +msgstr "paiement valide" + #: registration/models.py:382 #, python-brace-format msgid "Payment of {registration}" diff --git a/participation/models.py b/participation/models.py index c2f23e0..93031bc 100644 --- a/participation/models.py +++ b/participation/models.py @@ -323,7 +323,7 @@ class Participation(models.Model): valid = models.BooleanField( null=True, default=None, - verbose_name=_("valid"), + verbose_name=_("valid team"), help_text=_("The participation got the validation of the organizers."), ) diff --git a/registration/admin.py b/registration/admin.py index 60a9e4d..fe59a83 100644 --- a/registration/admin.py +++ b/registration/admin.py @@ -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 diff --git a/registration/models.py b/registration/models.py index cf9da7f..6af1ebc 100644 --- a/registration/models.py +++ b/registration/models.py @@ -370,7 +370,7 @@ class Payment(models.Model): ) valid = models.BooleanField( - verbose_name=_("valid"), + verbose_name=_("payment valid"), null=True, default=False, )