Commit 8fdb58dd by Yvon Kerdoncuff

several typo-like bug fixes

parent a940f299
Pipeline #4090 failed with stage
in 0 seconds
...@@ -573,21 +573,23 @@ def shift_subscription(request): ...@@ -573,21 +573,23 @@ def shift_subscription(request):
except MembersAppException as e: except MembersAppException as e:
return JsonResponse({"message": str(e)}, status=409) return JsonResponse({"message": str(e)}, status=409)
if curated_data["unsubscribe_first"]: if curated_data["unsubscribe_first"]:
if res["moving_from_standard_to_ftop"]: if curated_data["moving_from_std_to_ftop"]:
# Hard unsubscribe (unselecting all makeups) # Hard unsubscribe (unselecting all makeups)
m.unsubscribe_member() m.unsubscribe_member()
else: else:
# Unselect makeups on target shift_template # Unselect makeups on target shift_template
# (they would prevent new subscription) # (they would prevent new subscription)
cs = CagetteShift() cs = CagetteShift()
cs.unselect_makeup(curated_data["makeups_reg_on_target_shift_template"]) makeup_reg_ids = curated_data["makeups_reg_on_target_shift_template"]
if makeup_reg_ids:
cs.unselect_makeup(makeup_reg_ids)
# Perform soft unsubscribe that only unselect # Perform soft unsubscribe that only unselect
# makeups of shift_template to cancel (and # makeups of shift_template to cancel (and
# not makeups that are not linked to it) # not makeups that are not linked to it)
m.unsubscribe_member_but_exogenous_makeups() m.unsubscribe_member_but_exogenous_makeups()
reg_id = m.create_coop_shift_subscription( reg_id = m.create_coop_shift_subscription(
curated_data["target_shift_template_id"], curated_data["target_shift_template_id"],
curated_data["shift_type"] curated_data["target_shift_type"]
) )
# Return necessary data # Return necessary data
if reg_id is not None: if reg_id is not None:
......
...@@ -1068,7 +1068,7 @@ class CagetteMember(models.Model): ...@@ -1068,7 +1068,7 @@ class CagetteMember(models.Model):
def get_makeup_registrations_ids_on_shift_template(self, shift_template_id): def get_makeup_registrations_ids_on_shift_template(self, shift_template_id):
""" Get the makeup registrations that are on a shift template """ """ Get the makeup registrations that are on a shift template """
makeup_reg_ids = [] makeup_reg_ids = []
res_shift_ids = shifts.fonctions.get_scheduled_makeups(self.api, partner_ids=[self.id]) res_shift_ids = shifts.fonctions.get_scheduled_makeups(self.o_api, partner_ids=[self.id])
for shift_reg in res_shift_ids: for shift_reg in res_shift_ids:
c = [["id", "=", int(shift_reg['shift_id'][0])]] c = [["id", "=", int(shift_reg['shift_id'][0])]]
f = ['shift_template_id'] f = ['shift_template_id']
......
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