Skip to content
Snippets Groups Projects
Commit 5cb4219c authored by David Douard's avatar David Douard
Browse files

Use default list of load task types if the scheduler returns none of them

In some test scenarios, task types may not be registered.
parent 4a19c921
No related branches found
No related tags found
No related merge requests found
......@@ -179,8 +179,14 @@ def get_savable_visit_types_dict(privileged_user: bool = False) -> Dict:
# filter visit types according to scheduler load task types if available
try:
load_task_types = get_scheduler_load_task_types()
assert load_task_types, "Empty load task types from scheduler"
return {k: v for k, v in task_types.items() if v in load_task_types}
except Exception:
except Exception as exc:
logger.warning(
"Could not retrieve load task types from the scheduler. "
"Fall back to the default hardcoded list. Error was: %s",
exc,
)
return task_types
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment