Skip to content

Commit

Permalink
remove blocker when updating code (aiidalab#521)
Browse files Browse the repository at this point in the history
 Remove the code blocker when updating code widgets.
  • Loading branch information
superstar54 authored Oct 21, 2023
1 parent 0006ac2 commit 7493d26
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/aiidalab_qe/app/submission/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"])
Expand Down
5 changes: 5 additions & 0 deletions tests/test_codes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 7493d26

Please sign in to comment.