mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-07-01 05:21:15 +02:00
Compare commits
6 Commits
v1.0.1
...
420a24ebac
Author | SHA1 | Date | |
---|---|---|---|
420a24ebac | |||
d566def706 | |||
eaf6769e8b | |||
a61ec81cff | |||
60f2a73cc5 | |||
bcd96b2ed8 |
@ -13,15 +13,29 @@ SPDX-License-Identifier: GPL-3.0-or-later
|
||||
{% if additional_fee_renewal %}
|
||||
<div class="alert alert-warning">
|
||||
{% if renewal %}
|
||||
{% blocktrans trimmed with clubs=clubs_renewal|join:", " pretty_fee=additional_fee_renewal|pretty_money %}
|
||||
The user is not a member of the club·s {{ clubs }}. An additional fee of {{ pretty_fee }}
|
||||
will be charged to renew automatically the membership in this/these club·s.
|
||||
{% endblocktrans %}
|
||||
{% if club.name == "Kfet" %} {# Auto-renewal #}
|
||||
{% blocktrans trimmed with clubs=clubs_renewal|join:", " pretty_fee=additional_fee_renewal|pretty_money %}
|
||||
The user is not a member of the club·s {{ clubs }}. An additional fee of {{ pretty_fee }}
|
||||
will be charged to renew automatically the membership in this/these club·s.
|
||||
{% endblocktrans %}
|
||||
{% else %}
|
||||
{% blocktrans trimmed with clubs=clubs_renewal|join:", " pretty_fee=additional_fee_renewal|pretty_money %}
|
||||
The user is not a member of the club·s {{ clubs }}. Please create the required memberships,
|
||||
otherwise it will fail.
|
||||
{% endblocktrans %}
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% blocktrans trimmed with clubs=clubs_renewal|join:", " pretty_fee=additional_fee_renewal|pretty_money %}
|
||||
This club has parents {{ clubs }}. An additional fee of {{ pretty_fee }}
|
||||
will be charged to adhere automatically to this/these club·s.
|
||||
{% endblocktrans %}
|
||||
{% if club.name == "Kfet" %}
|
||||
{% blocktrans trimmed with clubs=clubs_renewal|join:", " pretty_fee=additional_fee_renewal|pretty_money %}
|
||||
This club has parents {{ clubs }}. An additional fee of {{ pretty_fee }}
|
||||
will be charged to adhere automatically to this/these club·s.
|
||||
{% endblocktrans %}
|
||||
{% else %}
|
||||
{% blocktrans trimmed with clubs=clubs_renewal|join:", " pretty_fee=additional_fee_renewal|pretty_money %}
|
||||
This club has parents {{ clubs }}. Please make sure that the user is a member of this or these club·s,
|
||||
otherwise the creation of this membership will fail.
|
||||
{% endblocktrans %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
@ -610,6 +610,9 @@ class ClubAddMemberView(ProtectQuerysetMixin, ProtectedCreateView):
|
||||
bank = form.cleaned_data["bank"]
|
||||
soge = form.cleaned_data["soge"] and not user.profile.soge and (club.name == "BDE" or club.name == "Kfet")
|
||||
|
||||
if not credit_type:
|
||||
credit_amount = 0
|
||||
|
||||
if not soge and user.note.balance + credit_amount < fee and not Membership.objects.filter(
|
||||
club__name="Kfet",
|
||||
user=user,
|
||||
@ -631,6 +634,16 @@ class ClubAddMemberView(ProtectQuerysetMixin, ProtectedCreateView):
|
||||
form.add_error('user', _('User is already a member of the club'))
|
||||
error = True
|
||||
|
||||
# Must join the parent club before joining this club, except for the Kfet club where it can be at the same time.
|
||||
if club.name != "Kfet" and club.parent_club and not Membership.objects.filter(
|
||||
user=form.instance.user,
|
||||
club=club.parent_club,
|
||||
date_start__lte=club.parent_club.membership_start,
|
||||
date_end__gte=club.parent_club.membership_end,
|
||||
).exists():
|
||||
form.add_error('user', _('User is not a member of the parent club') + ' ' + club.parent_club.name)
|
||||
error = True
|
||||
|
||||
if club.membership_start and form.instance.date_start < club.membership_start:
|
||||
form.add_error('user', _("The membership must start after {:%m-%d-%Y}.")
|
||||
.format(form.instance.club.membership_start))
|
||||
|
@ -253,7 +253,7 @@ function consume (source, source_alias, dest, quantity, amount, reason, type, ca
|
||||
template: template
|
||||
}).done(function () {
|
||||
reset()
|
||||
addMsg("La transaction n'a pas pu être validée pour cause de solde insuffisant.", 'danger', 10000)
|
||||
addMsg(gettext("La transaction n'a pas pu être validée pour cause de solde insuffisant."), 'danger', 10000)
|
||||
}).fail(function () {
|
||||
reset()
|
||||
errMsg(e.responseJSON)
|
||||
|
@ -159,7 +159,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
|
||||
{% endblock %}
|
||||
|
||||
{% block extrajavascript %}
|
||||
<script type="text/javascript" src="{% static "note/js/consos.js" %}"></script>
|
||||
<script type="text/javascript" src="{% static "note/js/consos.js" 'javascript-catalog' %}"></script>
|
||||
<script type="text/javascript">
|
||||
{% for button in highlighted %}
|
||||
{% if button.display %}
|
||||
|
@ -2775,6 +2775,22 @@
|
||||
"description": "Modifier n'importe quel profil non encore inscrit"
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "permission.permission",
|
||||
"pk": 178,
|
||||
"fields": {
|
||||
"model": [
|
||||
"note",
|
||||
"alias"
|
||||
],
|
||||
"query": "{}",
|
||||
"type": "view",
|
||||
"mask": 3,
|
||||
"field": "",
|
||||
"permanent": false,
|
||||
"description": "Voir tous les alias, y compris ceux des non adhérents"
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "permission.role",
|
||||
"pk": 1,
|
||||
@ -2986,7 +3002,8 @@
|
||||
174,
|
||||
175,
|
||||
176,
|
||||
177
|
||||
177,
|
||||
178
|
||||
]
|
||||
}
|
||||
},
|
||||
@ -3168,7 +3185,8 @@
|
||||
174,
|
||||
175,
|
||||
176,
|
||||
177
|
||||
177,
|
||||
178
|
||||
]
|
||||
}
|
||||
},
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -3,7 +3,7 @@
|
||||
"model": "sites.site",
|
||||
"pk": 1,
|
||||
"fields": {
|
||||
"domain": "localhost",
|
||||
"domain": "note.crans.org",
|
||||
"name": "La Note Kfet \ud83c\udf7b"
|
||||
}
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ from django.conf.urls.static import static
|
||||
from django.urls import path, include
|
||||
from django.views.defaults import bad_request, permission_denied, page_not_found, server_error
|
||||
from django.views.generic import RedirectView
|
||||
from django.views.i18n import JavaScriptCatalog
|
||||
|
||||
from member.views import CustomLoginView
|
||||
|
||||
@ -34,6 +35,9 @@ urlpatterns = [
|
||||
|
||||
# Make coffee
|
||||
path('coffee/', include('django_htcpcp_tea.urls')),
|
||||
|
||||
# Translate js
|
||||
path('jsi18n/', JavaScriptCatalog.as_view(), name='javascript-catalog'),
|
||||
]
|
||||
|
||||
# During development, serve media files
|
||||
|
Reference in New Issue
Block a user