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

check if the code is installed and usable #669

Merged
merged 2 commits into from
Apr 11, 2024
Merged
Changes from 1 commit
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
6 changes: 5 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,11 @@ 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.
if _get_code_uuid(codes.get(name)) in code.code_select_dropdown.options:
code.value = _get_code_uuid(codes.get(name))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any issue if code.value is not defined ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review. The code is a ComputationalResourcesWidget, which always has a value attribute.


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