Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace check of empty string in unfilled template widgets to None #650

Merged
merged 1 commit into from
Jan 5, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading