mirror of
https://github.com/ae-utbm/sith.git
synced 2026-04-18 01:08:23 +00:00
add forgotten check
This commit is contained in:
@@ -245,7 +245,6 @@ class ClubRole(OrderedModel):
|
|||||||
class Meta(OrderedModel.Meta):
|
class Meta(OrderedModel.Meta):
|
||||||
verbose_name = _("club role")
|
verbose_name = _("club role")
|
||||||
verbose_name_plural = _("club roles")
|
verbose_name_plural = _("club roles")
|
||||||
abstract = False
|
|
||||||
constraints = [
|
constraints = [
|
||||||
# presidency IMPLIES board <=> NOT presidency OR board
|
# presidency IMPLIES board <=> NOT presidency OR board
|
||||||
# cf. MT1 :)
|
# cf. MT1 :)
|
||||||
@@ -276,14 +275,26 @@ class ClubRole(OrderedModel):
|
|||||||
% {"name": self.name}
|
% {"name": self.name}
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
roles = list(self.club.roles.all())
|
||||||
if (
|
if (
|
||||||
self.is_board
|
self.is_board
|
||||||
and self.order
|
and self.order
|
||||||
and self.club.roles.filter(is_board=False, order__lt=self.order).exists()
|
and any(r.order < self.order and not r.is_board for r in roles)
|
||||||
):
|
):
|
||||||
errors.append(
|
errors.append(
|
||||||
ValidationError(
|
ValidationError(
|
||||||
_("Board role %(role)s cannot be placed below a member role")
|
_("Role %(role)s cannot be placed below a member role")
|
||||||
|
% {"role": self.name}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
if (
|
||||||
|
self.is_presidency
|
||||||
|
and self.order
|
||||||
|
and any(r.order < self.order and not r.is_presidency for r in roles)
|
||||||
|
):
|
||||||
|
errors.append(
|
||||||
|
ValidationError(
|
||||||
|
_("Role %(role)s cannot be placed below a non-presidency role")
|
||||||
% {"role": self.name}
|
% {"role": self.name}
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ def test_order_auto():
|
|||||||
"""Test that newly created roles are put in the right place."""
|
"""Test that newly created roles are put in the right place."""
|
||||||
club = baker.make(Club)
|
club = baker.make(Club)
|
||||||
recipe = Recipe(ClubRole, club=club, name=seq("role "))
|
recipe = Recipe(ClubRole, club=club, name=seq("role "))
|
||||||
# bulk create initial roles
|
# bulk create initial roles (1 presidency, 1 board, 1 member)
|
||||||
roles = recipe.make(
|
roles = recipe.make(
|
||||||
is_board=iter([True, True, False]),
|
is_board=iter([True, True, False]),
|
||||||
is_presidency=iter([True, False, False]),
|
is_presidency=iter([True, False, False]),
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2026-03-23 22:21+0100\n"
|
"POT-Creation-Date: 2026-04-16 19:05+0200\n"
|
||||||
"PO-Revision-Date: 2016-07-18\n"
|
"PO-Revision-Date: 2016-07-18\n"
|
||||||
"Last-Translator: Maréchal <thomas.girod@utbm.fr\n"
|
"Last-Translator: Maréchal <thomas.girod@utbm.fr\n"
|
||||||
"Language-Team: AE info <ae.info@utbm.fr>\n"
|
"Language-Team: AE info <ae.info@utbm.fr>\n"
|
||||||
@@ -242,7 +242,8 @@ msgstr "Rôle de la présidence"
|
|||||||
msgid ""
|
msgid ""
|
||||||
"If the role is inactive, people joining the club won't be able to get it."
|
"If the role is inactive, people joining the club won't be able to get it."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Si ce rôle est inactif, il ne pourra pas être attribué aux gens qui rejoignent le club."
|
"Si ce rôle est inactif, il ne pourra pas être attribué aux gens qui "
|
||||||
|
"rejoignent le club."
|
||||||
|
|
||||||
#: club/models.py
|
#: club/models.py
|
||||||
msgid "club role"
|
msgid "club role"
|
||||||
@@ -257,12 +258,22 @@ msgstr "rôles de club"
|
|||||||
msgid ""
|
msgid ""
|
||||||
"Role %(name)s was declared as a presidency role without being a board role"
|
"Role %(name)s was declared as a presidency role without being a board role"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Le rôle %(name)s a été déclaré comme rôle de présidence sans être un rôle du bureau."
|
"Le rôle %(name)s a été déclaré comme rôle de présidence sans être un rôle du "
|
||||||
|
"bureau."
|
||||||
|
|
||||||
#: club/models.py
|
#: club/models.py
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "Board role %(role)s cannot be placed below a member role"
|
msgid "Role %(role)s cannot be placed below a member role"
|
||||||
msgstr "Le rôle du bureau %(role)s ne peut pas être placé en-dessous d'un rôle de membre."
|
msgstr ""
|
||||||
|
"Le rôle %(role)s ne peut pas être placé en-dessous d'un rôle de "
|
||||||
|
"membre."
|
||||||
|
|
||||||
|
#: club/models.py
|
||||||
|
#, python-format
|
||||||
|
msgid "Role %(role)s cannot be placed below a non-presidency role"
|
||||||
|
msgstr ""
|
||||||
|
"Le rôle %(role)s ne peut pas être placé en-dessous d'un rôle de "
|
||||||
|
"membre."
|
||||||
|
|
||||||
#: club/models.py core/models.py counter/models.py eboutic/models.py
|
#: club/models.py core/models.py counter/models.py eboutic/models.py
|
||||||
#: election/models.py pedagogy/models.py sas/models.py trombi/models.py
|
#: election/models.py pedagogy/models.py sas/models.py trombi/models.py
|
||||||
@@ -4250,6 +4261,47 @@ msgstr ""
|
|||||||
msgid "this page"
|
msgid "this page"
|
||||||
msgstr "cette page"
|
msgstr "cette page"
|
||||||
|
|
||||||
|
#: eboutic/templates/eboutic/eboutic_main.jinja
|
||||||
|
msgid "Eurockéennes 2025 partnership"
|
||||||
|
msgstr "Partenariat Eurockéennes 2025"
|
||||||
|
|
||||||
|
#: eboutic/templates/eboutic/eboutic_main.jinja
|
||||||
|
msgid ""
|
||||||
|
"Our partner uses Weezevent to sell tickets. Weezevent may collect user info "
|
||||||
|
"according to its own privacy policy. By clicking the accept button you "
|
||||||
|
"consent to their terms of services."
|
||||||
|
msgstr ""
|
||||||
|
"Notre partenaire utilises Wezevent pour vendre ses billets. Weezevent peut "
|
||||||
|
"collecter des informations utilisateur conformément à sa propre politique de "
|
||||||
|
"confidentialité. En cliquant sur le bouton d'acceptation vous consentez à "
|
||||||
|
"leurs termes de service."
|
||||||
|
|
||||||
|
#: eboutic/templates/eboutic/eboutic_main.jinja
|
||||||
|
msgid "Privacy policy"
|
||||||
|
msgstr "Politique de confidentialité"
|
||||||
|
|
||||||
|
#: eboutic/templates/eboutic/eboutic_main.jinja
|
||||||
|
#: trombi/templates/trombi/comment_moderation.jinja
|
||||||
|
msgid "Accept"
|
||||||
|
msgstr "Accepter"
|
||||||
|
|
||||||
|
#: eboutic/templates/eboutic/eboutic_main.jinja
|
||||||
|
msgid ""
|
||||||
|
"You must be subscribed to benefit from the partnership with the Eurockéennes."
|
||||||
|
msgstr ""
|
||||||
|
"Vous devez être cotisant pour bénéficier du partenariat avec les "
|
||||||
|
"Eurockéennes."
|
||||||
|
|
||||||
|
#: eboutic/templates/eboutic/eboutic_main.jinja
|
||||||
|
#, python-format
|
||||||
|
msgid ""
|
||||||
|
"This partnership offers a discount of up to 33%% on tickets for Friday, "
|
||||||
|
"Saturday and Sunday, as well as the 3-day package from Friday to Sunday."
|
||||||
|
msgstr ""
|
||||||
|
"Ce partenariat permet de profiter d'une réduction jusqu'à 33%% sur les "
|
||||||
|
"billets du vendredi, du samedi et du dimanche, ainsi qu'au forfait 3 jours, "
|
||||||
|
"du vendredi au dimanche."
|
||||||
|
|
||||||
#: eboutic/templates/eboutic/eboutic_main.jinja
|
#: eboutic/templates/eboutic/eboutic_main.jinja
|
||||||
msgid "There are no items available for sale"
|
msgid "There are no items available for sale"
|
||||||
msgstr "Aucun article n'est disponible à la vente"
|
msgstr "Aucun article n'est disponible à la vente"
|
||||||
@@ -5640,10 +5692,6 @@ msgstr "fin"
|
|||||||
msgid "Moderate Trombi comments"
|
msgid "Moderate Trombi comments"
|
||||||
msgstr "Modérer les commentaires du Trombi"
|
msgstr "Modérer les commentaires du Trombi"
|
||||||
|
|
||||||
#: trombi/templates/trombi/comment_moderation.jinja
|
|
||||||
msgid "Accept"
|
|
||||||
msgstr "Accepter"
|
|
||||||
|
|
||||||
#: trombi/templates/trombi/comment_moderation.jinja
|
#: trombi/templates/trombi/comment_moderation.jinja
|
||||||
msgid "Reject"
|
msgid "Reject"
|
||||||
msgstr "Refuser"
|
msgstr "Refuser"
|
||||||
@@ -5885,39 +5933,3 @@ msgstr "Vous ne pouvez plus écrire de commentaires, la date est passée."
|
|||||||
#, python-format
|
#, python-format
|
||||||
msgid "Maximum characters: %(max_length)s"
|
msgid "Maximum characters: %(max_length)s"
|
||||||
msgstr "Nombre de caractères max: %(max_length)s"
|
msgstr "Nombre de caractères max: %(max_length)s"
|
||||||
|
|
||||||
#: eboutic/templates/eboutic/eboutic_main.jinja
|
|
||||||
msgid "Eurockéennes 2025 partnership"
|
|
||||||
msgstr "Partenariat Eurockéennes 2025"
|
|
||||||
|
|
||||||
#: eboutic/templates/eboutic/eboutic_main.jinja
|
|
||||||
msgid ""
|
|
||||||
"Our partner uses Weezevent to sell tickets. Weezevent may collect user info "
|
|
||||||
"according to its own privacy policy. By clicking the accept button you "
|
|
||||||
"consent to their terms of services."
|
|
||||||
msgstr ""
|
|
||||||
"Notre partenaire utilises Wezevent pour vendre ses billets. Weezevent peut "
|
|
||||||
"collecter des informations utilisateur conformément à sa propre politique de "
|
|
||||||
"confidentialité. En cliquant sur le bouton d'acceptation vous consentez à "
|
|
||||||
"leurs termes de service."
|
|
||||||
|
|
||||||
#: eboutic/templates/eboutic/eboutic_main.jinja
|
|
||||||
msgid "Privacy policy"
|
|
||||||
msgstr "Politique de confidentialité"
|
|
||||||
|
|
||||||
#: eboutic/templates/eboutic/eboutic_main.jinja
|
|
||||||
msgid ""
|
|
||||||
"You must be subscribed to benefit from the partnership with the Eurockéennes."
|
|
||||||
msgstr ""
|
|
||||||
"Vous devez être cotisant pour bénéficier du partenariat avec les "
|
|
||||||
"Eurockéennes."
|
|
||||||
|
|
||||||
#: eboutic/templates/eboutic/eboutic_main.jinja
|
|
||||||
#, python-format
|
|
||||||
msgid ""
|
|
||||||
"This partnership offers a discount of up to 33%% on tickets for Friday, "
|
|
||||||
"Saturday and Sunday, as well as the 3-day package from Friday to Sunday."
|
|
||||||
msgstr ""
|
|
||||||
"Ce partenariat permet de profiter d'une réduction jusqu'à 33%% sur les "
|
|
||||||
"billets du vendredi, du samedi et du dimanche, ainsi qu'au forfait 3 jours, "
|
|
||||||
"du vendredi au dimanche."
|
|
||||||
|
|||||||
Reference in New Issue
Block a user