Commit 8d05ac97 by Yvon Kerdoncuff

#7316 : trigger error when trying to add makeup which would unsubscribe a member from admin bdm

parent 02ee410b
Pipeline #4047 failed with stage
...@@ -409,6 +409,12 @@ def update_members_makeups(request): ...@@ -409,6 +409,12 @@ def update_members_makeups(request):
return JsonResponse(error, status=400) return JsonResponse(error, status=400)
makeup_change_count = target_makeups_nb - cs.get_member_makeups_to_do(cm.id) makeup_change_count = target_makeups_nb - cs.get_member_makeups_to_do(cm.id)
members_data[member_data["member_id"]]["points_diff"] = - makeup_change_count members_data[member_data["member_id"]]["points_diff"] = - makeup_change_count
points_target = cm.get_member_points("standard") - makeup_change_count
if points_target <= unsubscription_limit:
error = []
error["error"]\
= "L'ajout de rattrapage a été annulé car il provoquerait la désinscription d'un membre."
return JsonResponse(error, status=400)
res["res"] = [] res["res"] = []
update_members_makeups_core(members_data, res) update_members_makeups_core(members_data, res)
......
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