Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Use pop to get value from dict

Mira Szewczykbe41f660defb
diff --git a/saleor/dashboard/payment/forms.py b/saleor/dashboard/payment/forms.py
index 9c0acb493a..0dab492cbc 100644
--- a/saleor/dashboard/payment/forms.py
+++ b/saleor/dashboard/payment/forms.py
@@ -48,8 +48,7 @@ class GatewayConfigurationForm(forms.ModelForm):
def parse_values(self):
cleaned_data = self.cleaned_data
- active = cleaned_data.get("active")
- cleaned_data.pop("active")
+ active = cleaned_data.pop("active", False)
data = {"active": active}
data["configuration"] = list(cleaned_data.values())
return data