Merge pull request #1390 from SchrodingersGat/CI-fixes

Hide fields rather than pop, to reduce warnings in CI logs
This commit is contained in:
Oliver authored and GitHub committed 2021-03-04 22:42:17 +11:00
commit c46fe354c2
2 files changed
+4 -4

No files matched your search

+2 -2
View File
@@ -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()
+2 -2
View File
@@ -1232,7 +1232,7 @@ class StockItemEdit(AjaxUpdateView):
# Hide the "expiry date" field if the feature is not enabled
if not common.settings.stock_expiry_enabled():
form.fields.pop('expiry_date')
form.fields['expiry_date'].widget = HiddenInput()
item = self.get_object()
@@ -1581,7 +1581,7 @@ class StockItemCreate(AjaxCreateView):
# Hide the "expiry date" field if the feature is not enabled
if not common.settings.stock_expiry_enabled():
form.fields.pop('expiry_date')
form.fields['expiry_date'].widget = HiddenInput()
part = self.get_part(form=form)