diff --git a/apps/permission/fixtures/initial.json b/apps/permission/fixtures/initial.json index 9e4ba924..5b8dbed9 100644 --- a/apps/permission/fixtures/initial.json +++ b/apps/permission/fixtures/initial.json @@ -3751,6 +3751,21 @@ "permanent": false, "description": "Modifier bouffe" } + }, { + "model": "permission.permission", + "pk": 239, + "fields": { + "model": [ + "note", + "alias" + ], + "query": "[\"AND\", [\"OR\", {\"note__noteuser__user__memberships__club\": \"club\", \"note__noteuser__user__memberships__date_start__lte\": [\"today\"], \"note__noteuser__user__memberships__date_end__gte\": [\"today\"]}, {\"note__noteclub__isnull\": false}], {\"note__is_active\": true}]", + "type": "view", + "mask": 1, + "field": "", + "permanent": false, + "description": "Voir les alias des notes des clubs et des adhérent⋅es du club BDE" + } }, { "model": "permission.role", @@ -3851,6 +3866,19 @@ "for_club": null, "name": "Membre de club", "permissions": [ + 1, + 2, + 3, + 4, + 5, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, 22 ] } @@ -3913,7 +3941,8 @@ 142, 182, 184, - 185 + 185, + 239 ] } }, diff --git a/apps/registration/views.py b/apps/registration/views.py index f0314285..99159a78 100644 --- a/apps/registration/views.py +++ b/apps/registration/views.py @@ -300,10 +300,13 @@ class FutureUserDetailView(ProtectQuerysetMixin, LoginRequiredMixin, FormMixin, # join_bde = True # join_kfet = True - if not join_bde: + if not (join_bde or any(b for _, b in join_clubs)): # This software belongs to the BDE. - form.add_error('join_bde', _("You must join the BDE.")) + form.add_error('join_bde', _("You must join a club.")) return super().form_invalid(form) + + if join_kfet and not join_bde: + forl.add_error('join_bde', _("You must also join the parent club BDE.")) # Calculate required registration fee fee = 0