From 308c01bae4f9294f876a85b1cf5c212f2e9d253c Mon Sep 17 00:00:00 2001 From: Sebastien Renard Date: Mon, 25 Nov 2024 20:00:11 +0100 Subject: [PATCH] don't put in first place current value when... not value is defined for billing mode --- staffing/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/staffing/views.py b/staffing/views.py index 7cab3d99..4eb2c4c5 100644 --- a/staffing/views.py +++ b/staffing/views.py @@ -1816,7 +1816,8 @@ def mission_update(request): mission = Mission.objects.get(id=mission_id) # If no mission found, it fails, that's what we want if attribute == "billing_mode": values = dict(Mission.BILLING_MODES) - values = {mission.billing_mode: values.pop(mission.billing_mode), **values} + if mission.billing_mode: + values = {mission.billing_mode: values.pop(mission.billing_mode), **values} if mission.management_mode == "ELASTIC": del values["FIXED_PRICE"] elif attribute == "management_mode":