From 6c5182fb1de112ba16cc29fef93ecca79b21a89e Mon Sep 17 00:00:00 2001 From: cgutierr Date: Wed, 4 Jan 2023 10:32:44 +0100 Subject: [PATCH 1/2] Hot-fix. Ref autosubmitreact#64 --- autosubmit_api/experiment/common_requests.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/autosubmit_api/experiment/common_requests.py b/autosubmit_api/experiment/common_requests.py index 6e47b36e..570c3a1f 100644 --- a/autosubmit_api/experiment/common_requests.py +++ b/autosubmit_api/experiment/common_requests.py @@ -1328,15 +1328,14 @@ def get_current_configuration_by_expid(expid, valid_user, log): currentFileSystemConfig = {} def removeParameterDuplication(currentDict, keyToRemove, exceptionsKeys=[]): - if currentDict and isinstance(currentDict, dict): + if "exp" in currentDict.keys() and isinstance(currentDict["exp"], dict): try: - for k, nested_d in currentDict.items(): + for k, nested_d in list(currentDict["exp"].items()): if k not in exceptionsKeys and isinstance(nested_d, dict): nested_d.pop(keyToRemove, None) except Exception as exp: log.info("Error while trying to eliminate duplicated key from config.") pass - return currentDict try: if not valid_user: @@ -1375,21 +1374,22 @@ def get_current_configuration_by_expid(expid, valid_user, log): warning_message = "The filesystem system configuration can't be retrieved because '{}'".format( exp) currentFileSystemConfig["contains_nones"] = True + log.info(warning_message) pass - removeParameterDuplication(currentRunConfig['exp'], "EXPID", ["experiment"]) - removeParameterDuplication(currentFileSystemConfig['exp'], "EXPID", ["experiment"]) + removeParameterDuplication(currentRunConfig, "EXPID", ["experiment"]) + removeParameterDuplication(currentFileSystemConfig, "EXPID", ["experiment"]) except Exception as exp: error = True error_message = str(exp) currentRunConfig["contains_nones"] = True currentFileSystemConfig["contains_nones"] = True + log.info("Exception while generating the configuration: " + error_message) pass return {"error": error, "error_message": error_message, "warning": warning, "warning_message": warning_message, "configuration_current_run": currentRunConfig, "configuration_filesystem": currentFileSystemConfig, "are_equal": currentRunConfig == currentFileSystemConfig} - def get_experiment_runs(expid): """ Get runs of the same experiment from historical db -- GitLab From 915a1646f4bf000cf5bd631e3ec01f10dd3c8419 Mon Sep 17 00:00:00 2001 From: cgutierr Date: Wed, 4 Jan 2023 10:35:13 +0100 Subject: [PATCH 2/2] Remove validation from backend. Ref autosubmitreact#42 --- autosubmit_api/experiment/common_requests.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/autosubmit_api/experiment/common_requests.py b/autosubmit_api/experiment/common_requests.py index 570c3a1f..8079ebea 100644 --- a/autosubmit_api/experiment/common_requests.py +++ b/autosubmit_api/experiment/common_requests.py @@ -1338,9 +1338,6 @@ def get_current_configuration_by_expid(expid, valid_user, log): pass try: - if not valid_user: - raise Exception( - "You have to be logged in to access this information.") allowedConfigKeys = ['conf', 'exp', 'jobs', 'platforms', 'proj'] BasicConfig.read() historicalDatabase = JobData.JobDataStructure(expid, BasicConfig) -- GitLab