Commit 04f149b4 by Damien Moulard

add origin to keep track of shifts canceled after extra shift done

parent 3368b375
Pipeline #2408 passed with stage
in 1 minute 40 seconds
...@@ -334,10 +334,9 @@ def cancel_shift(request): ...@@ -334,10 +334,9 @@ def cancel_shift(request):
listRegister = [int(request.POST['idRegister'])] listRegister = [int(request.POST['idRegister'])]
try: try:
response = cs.cancel_shift(listRegister)
# decrement extra_shift_done if param exists # decrement extra_shift_done if param exists
if 'extra_shift_done' in request.POST: if 'extra_shift_done' in request.POST:
response = cs.cancel_shift(listRegister, origin='memberspace extra shift done')
target = int(request.POST["extra_shift_done"]) - 1 target = int(request.POST["extra_shift_done"]) - 1
# extra security # extra security
...@@ -346,6 +345,8 @@ def cancel_shift(request): ...@@ -346,6 +345,8 @@ def cancel_shift(request):
cm = CagetteMember(partner_id) cm = CagetteMember(partner_id)
cm.update_extra_shift_done(target) cm.update_extra_shift_done(target)
else:
response = cs.cancel_shift(listRegister)
return JsonResponse({"res" : 'response'}) return JsonResponse({"res" : 'response'})
except Exception as e: except Exception as e:
......
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