Merge branch 'non-BDE-members' into 'main'

Allow non-BDE members to use the note

See merge request bde/nk20!268
This commit is contained in:
bleizi 2024-09-05 23:15:04 +02:00
commit 33c94d0720
3 changed files with 4421 additions and 4353 deletions

View File

@ -3752,6 +3752,54 @@
"description": "Modifier bouffe" "description": "Modifier bouffe"
} }
}, },
{
"model": "permission.permission",
"pk": 239,
"fields": {
"model": [
"note",
"alias"
],
"query": "[\"AND\", {\"note__noteuser__user__memberships__club\": [\"club\"], \"note__noteuser__user__memberships__date_start__lte\": [\"today\"], \"note__noteuser__user__memberships__date_end__gte\": [\"today\"]}, {\"note__is_active\": true}]",
"type": "view",
"mask": 2,
"field": "",
"permanent": false,
"description": "Voir les alias des notes des adhérent⋅es du club"
}
},
{
"model": "permission.permission",
"pk": 240,
"fields": {
"model": [
"note",
"alias"
],
"query": "[\"AND\", {\"note__noteuser__user__memberships__club\": [\"club\", \"parent_club\"], \"note__noteuser__user__memberships__date_start__lte\": [\"today\"], \"note__noteuser__user__memberships__date_end__gte\": [\"today\"]}, {\"note__is_active\": true}]",
"type": "view",
"mask": 2,
"field": "",
"permanent": false,
"description": "Voir les alias des notes des adhérent⋅es du club parent"
}
},
{
"model": "permission.permission",
"pk": 241,
"fields": {
"model": [
"auth",
"user"
],
"query": "[\"AND\", {\"memberships__club\": [\"club\", \"parent_club\"], \"memberships__date_start__lte\": [\"today\"], \"memberships__date_end__gte\": [\"today\"]}, {\"note__is_active\": true}]",
"type": "view",
"mask": 2,
"field": "",
"permanent": false,
"description": "Voir les utilisateurs adhérents au club parent"
}
},
{ {
"model": "permission.role", "model": "permission.role",
"pk": 1, "pk": 1,
@ -3851,6 +3899,19 @@
"for_club": null, "for_club": null,
"name": "Membre de club", "name": "Membre de club",
"permissions": [ "permissions": [
1,
2,
3,
4,
5,
7,
8,
9,
10,
11,
12,
13,
14,
22 22
] ]
} }
@ -3913,7 +3974,10 @@
142, 142,
182, 182,
184, 184,
185 185,
239,
240,
241
] ]
} }
}, },

View File

@ -300,9 +300,13 @@ class FutureUserDetailView(ProtectQuerysetMixin, LoginRequiredMixin, FormMixin,
# join_bde = True # join_bde = True
# join_kfet = 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. # 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:
form.add_error('join_bde', _("You must also join the parent club BDE."))
return super().form_invalid(form) return super().form_invalid(form)
# Calculate required registration fee # Calculate required registration fee

View File

@ -72,7 +72,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
<a class="nav-link {% if request.path_info == url %}active{% endif %}" href="{{ url }}"><i class="fa fa-cutlery"></i> {% trans 'Food' %}</a> <a class="nav-link {% if request.path_info == url %}active{% endif %}" href="{{ url }}"><i class="fa fa-cutlery"></i> {% trans 'Food' %}</a>
</li> </li>
{% endif %} {% endif %}
{% if user.is_authenticated and user|is_member:"Kfet" %} {% if user.is_authenticated %}
<li class="nav-item"> <li class="nav-item">
{% url 'note:transfer' as url %} {% url 'note:transfer' as url %}
<a class="nav-link {% if request.path_info == url %}active{% endif %}" href="{{ url }}"><i class="fa fa-exchange"></i> {% trans 'Transfer' %}</a> <a class="nav-link {% if request.path_info == url %}active{% endif %}" href="{{ url }}"><i class="fa fa-exchange"></i> {% trans 'Transfer' %}</a>