diff --git a/src/aiidalab_qe/app/submission/__init__.py b/src/aiidalab_qe/app/submission/__init__.py index c90b057da..ab0a7a5e2 100644 --- a/src/aiidalab_qe/app/submission/__init__.py +++ b/src/aiidalab_qe/app/submission/__init__.py @@ -89,6 +89,7 @@ def __init__(self, qe_auto_setup=True, **kwargs): for _, entry_point in self.code_entries.items(): for name, code in entry_point.items(): self.codes[name] = code + code.observe(self._update_state, "value") self.code_children.append(self.codes[name]) # set default codes self.set_selected_codes(DEFAULT_PARAMETERS["codes"]) diff --git a/tests/test_codes.py b/tests/test_codes.py index b4f388cd1..0498fba04 100644 --- a/tests/test_codes.py +++ b/tests/test_codes.py @@ -44,6 +44,11 @@ def test_identify_submission_blockers(app): blockers = list(submit._identify_submission_blockers()) assert len(blockers) == 1 # set dos code to None, will introduce another blocker + dos_value = submit.codes["dos"].value submit.codes["dos"].value = None blockers = list(submit._identify_submission_blockers()) assert len(blockers) == 2 + # set dos code back will remove the blocker + submit.codes["dos"].value = dos_value + blockers = list(submit._identify_submission_blockers()) + assert len(blockers) == 1