From d111e7bff028deabe8e214362846a4aaf5a455f5 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Thu, 4 Mar 2021 21:42:49 +1100 Subject: [PATCH] Hide fields rather than pop, to reduce warnings in CI logs --- InvenTree/part/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/InvenTree/part/views.py b/InvenTree/part/views.py index 1cb2976ff8..65f859566b 100644 --- a/InvenTree/part/views.py +++ b/InvenTree/part/views.py @@ -613,7 +613,7 @@ class PartCreate(AjaxCreateView): # Hide the "default expiry" field if the feature is not enabled if not inventree_settings.stock_expiry_enabled(): - form.fields.pop('default_expiry') + form.fields['default_expiry'].widget = HiddenInput() # Hide the default_supplier field (there are no matching supplier parts yet!) form.fields['default_supplier'].widget = HiddenInput() @@ -904,7 +904,7 @@ class PartEdit(AjaxUpdateView): # Hide the "default expiry" field if the feature is not enabled if not inventree_settings.stock_expiry_enabled(): - form.fields.pop('default_expiry') + form.fields['default_expiry'].widget = HiddenInput() part = self.get_object()