Skip to content

Commit

Permalink
check if the code is installed and usable (#669)
Browse files Browse the repository at this point in the history
if code is imported from another user, it is not usable and thus will not be treated as an option in the ComputationalResourcesWidget. This PR checks if the code is installed and usable.
  • Loading branch information
superstar54 authored Apr 11, 2024
1 parent 86f4aac commit dcb951d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/aiidalab_qe/app/submission/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,12 @@ def _get_code_uuid(code):

with self.hold_trait_notifications():
for name, code in self.codes.items():
code.value = _get_code_uuid(codes.get(name))
# check if the code is installed and usable
# note: if code is imported from another user, it is not usable and thus will not be
# treated as an option in the ComputationalResourcesWidget.
code_options = [o[1] for o in self.pw_code.code_select_dropdown.options]
if _get_code_uuid(codes.get(name)) in code_options:
code.value = _get_code_uuid(codes.get(name))

def update_codes_display(self):
"""Hide code if no related property is selected."""
Expand Down

0 comments on commit dcb951d

Please sign in to comment.