Commit edafd2a3 by Damien Moulard

block extension if member can't have it

parent 24013b6b
...@@ -44,7 +44,7 @@ function request_delay() { ...@@ -44,7 +44,7 @@ function request_delay() {
&& data.responseJSON.message === "delays limit reached") { && data.responseJSON.message === "delays limit reached") {
closeModal(); closeModal();
alert("Vous avez mis plus de 6 mois pour rattraper un service, " + alert("Vous avez mis plus de 6 mois pour rattraper un service, " +
"vous ne pouvez plus sélectionner de rattrapage depuis l'espace membre. " + "vous ne pouvez plus rien faire depuis l'espace membre. " +
"Merci de contacter le BDM."); "Merci de contacter le BDM.");
} else { } else {
err = {msg: "erreur serveur lors de la création du délai", ctx: 'request_delay'}; err = {msg: "erreur serveur lors de la création du délai", ctx: 'request_delay'};
......
...@@ -165,7 +165,11 @@ function init_my_info_data() { ...@@ -165,7 +165,11 @@ function init_my_info_data() {
}); });
} }
if (partner_data.makeups_to_do > 0 && partner_data.is_associated_people === "False") { if (
partner_data.makeups_to_do > 0
&& partner_data.is_associated_people === "False"
&& partner_data.cooperative_state !== 'unsubscribed'
) {
$(".choose_makeups").show(); $(".choose_makeups").show();
if ( if (
......
...@@ -267,13 +267,12 @@ def request_delay(request): ...@@ -267,13 +267,12 @@ def request_delay(request):
if Verification.verif_token(request.POST.get('verif_token'), int(request.POST.get('idPartner'))) is True: if Verification.verif_token(request.POST.get('verif_token'), int(request.POST.get('idPartner'))) is True:
cs = CagetteShift() cs = CagetteShift()
# TODO do we need this? use_new_members_space = getattr(settings, 'USE_NEW_MEMBERS_SPACE', False)
# use_new_members_space = getattr(settings, 'USE_NEW_MEMBERS_SPACE', False) if use_new_members_space is True:
# if use_new_members_space is True: member_can_have_delay = cs.member_can_have_delay(int(request.POST.get('idPartner')))
# member_can_have_delay = cs.member_can_have_delay(int(request.POST.get('idPartner'))) if member_can_have_delay is False:
# if member_can_have_delay is False: res = { 'message' : 'delays limit reached'}
# res = { 'message' : 'delays limit reached'} return JsonResponse(res, status=403)
# return JsonResponse(res, status=403)
data = { data = {
"idPartner": int(request.POST['idPartner']), "idPartner": int(request.POST['idPartner']),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment