From e77ba92e72a470f1c39ec5b518ada48a3500f219 Mon Sep 17 00:00:00 2001 From: Aliaksandr Yakutovich Date: Wed, 15 May 2024 15:36:02 +0200 Subject: [PATCH] Fix ComputationalResourcesDatabaseWidget (#601) When the code is not present in the default machine it should still work. --- aiidalab_widgets_base/databases.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/aiidalab_widgets_base/databases.py b/aiidalab_widgets_base/databases.py index 1cae81392..e3cf14bfd 100644 --- a/aiidalab_widgets_base/databases.py +++ b/aiidalab_widgets_base/databases.py @@ -353,9 +353,7 @@ def _database_generator(database_source, default_calc_job_plugin): if len(domain_value) == 0: # remove domain since no computers with required codes defined in this domain source del database[domain] - continue - - if domain_value["default"] not in domain_value: + elif domain_value.get("default") not in domain_value: # make sure default computer is still points to existing computer domain_value["default"] = sorted(domain_value.keys() - {"default"})[0]