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 2021-03-04 22:42:17 +11:00 committed by GitHub
commit c46fe354c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -613,7 +613,7 @@ class PartCreate(AjaxCreateView):
# Hide the "default expiry" field if the feature is not enabled # Hide the "default expiry" field if the feature is not enabled
if not inventree_settings.stock_expiry_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!) # Hide the default_supplier field (there are no matching supplier parts yet!)
form.fields['default_supplier'].widget = HiddenInput() form.fields['default_supplier'].widget = HiddenInput()
@ -904,7 +904,7 @@ class PartEdit(AjaxUpdateView):
# Hide the "default expiry" field if the feature is not enabled # Hide the "default expiry" field if the feature is not enabled
if not inventree_settings.stock_expiry_enabled(): if not inventree_settings.stock_expiry_enabled():
form.fields.pop('default_expiry') form.fields['default_expiry'].widget = HiddenInput()
part = self.get_object() part = self.get_object()

View File

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