Skip to content

Commit

Permalink
Add None to empty widget value check
Browse files Browse the repository at this point in the history
  • Loading branch information
edan-bainglass committed Dec 22, 2024
1 parent 0542daa commit 6544d18
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions aiidalab_widgets_base/computational_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -1302,13 +1302,6 @@ def _observe_code_setup(self, _=None):
for key, value in self.code_setup.items():
if hasattr(self, key):
if key == "default_calc_job_plugin":
if "None" in value:
# NOTE: Using this widget through the `_ResourceSetupBaseWidget`
# without an explicit `default_calc_job_plugin` causes `value`
# to be "<plugin>.None", which is not a valid plugin name.
# HACK to avoid the warning message
# TODO see https://github.com/aiidalab/aiidalab-widgets-base/issues/648
return
try:
self.default_calc_job_plugin.value = value
except tl.TraitError:
Expand Down Expand Up @@ -1597,7 +1590,7 @@ def fill(self):
# if the widget is not filled, use the original template var string e.g. {{ var }}
inp_dict = {}
for _var in line.vars:
if self._template_variables[_var].widget.value == "":
if self._template_variables[_var].widget.value in ("", None):
variable_key = self._template_variables[_var].widget.description
self.unfilled_variables.append(variable_key.strip(":"))
inp_dict[_var] = "{{ " + _var + " }}"
Expand Down

0 comments on commit 6544d18

Please sign in to comment.