From 033f8a68c15525aa3affcbe0e7584c07a8fe1a19 Mon Sep 17 00:00:00 2001 From: Sal Tijerina Date: Fri, 29 Sep 2023 15:13:18 -0500 Subject: [PATCH] handle missing default system; enable work as default system locally (#867) --- .../src/components/Applications/AppForm/AppForm.jsx | 2 +- server/portal/apps/datafiles/views.py | 2 +- server/portal/settings/settings.py | 2 +- server/portal/settings/settings_default.py | 13 ++++++------- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/client/src/components/Applications/AppForm/AppForm.jsx b/client/src/components/Applications/AppForm/AppForm.jsx index 65a7e61b9..b2b7ed793 100644 --- a/client/src/components/Applications/AppForm/AppForm.jsx +++ b/client/src/components/Applications/AppForm/AppForm.jsx @@ -205,7 +205,7 @@ export const AppSchemaForm = ({ app }) => { const hasCorral = configuration.length && ['corral.tacc.utexas.edu', 'data.tacc.utexas.edu'].some((s) => - defaultHost.endsWith(s) + defaultHost?.endsWith(s) ); return { allocations: matchingExecutionHost diff --git a/server/portal/apps/datafiles/views.py b/server/portal/apps/datafiles/views.py index e85d42069..8f0e769cd 100644 --- a/server/portal/apps/datafiles/views.py +++ b/server/portal/apps/datafiles/views.py @@ -48,7 +48,7 @@ def get(self, request): if 'homeDir' in system else system for system in portal_systems ] - default_system = settings.PORTAL_DATAFILES_DEFAULT_STORAGE_SYSTEM + default_system = settings.PORTAL_DATAFILES_DEFAULT_STORAGE_SYSTEM or settings.PORTAL_DATAFILES_STORAGE_SYSTEMS[0] if default_system: system_id = default_system.get('system') system_def = request.user.tapis_oauth.client.systems.getSystem(systemId=system_id, select='host') diff --git a/server/portal/settings/settings.py b/server/portal/settings/settings.py index e2e82770f..d4c6ae458 100644 --- a/server/portal/settings/settings.py +++ b/server/portal/settings/settings.py @@ -512,7 +512,7 @@ PORTAL_DATAFILES_STORAGE_SYSTEMS = getattr( settings_custom, '_PORTAL_DATAFILES_STORAGE_SYSTEMS', [] ) -PORTAL_DATAFILES_DEFAULT_STORAGE_SYSTEM = next((sys for sys in PORTAL_DATAFILES_STORAGE_SYSTEMS if sys['default'] is True), None) +PORTAL_DATAFILES_DEFAULT_STORAGE_SYSTEM = next((sys for sys in PORTAL_DATAFILES_STORAGE_SYSTEMS if sys.get('default')), None) PORTAL_SEARCH_MANAGERS = { 'my-data': 'portal.apps.search.api.managers.private_data_search.PrivateDataSearchManager', diff --git a/server/portal/settings/settings_default.py b/server/portal/settings/settings_default.py index 433b52d3b..443520033 100644 --- a/server/portal/settings/settings_default.py +++ b/server/portal/settings/settings_default.py @@ -59,22 +59,21 @@ _PORTAL_DATAFILES_STORAGE_SYSTEMS = [ { - 'name': 'My Data (Corral)', - 'system': 'cloud.data', + 'name': 'My Data (Work)', + 'system': 'frontera', 'scheme': 'private', 'api': 'tapis', - 'homeDir': '/home/{username}', + 'homeDir': '/work/{tasdir}', 'icon': None, - 'keyservice': True, 'default': True }, { - 'name': 'My Data (Work)', + 'name': 'My Data (Scratch)', 'system': 'frontera', 'scheme': 'private', 'api': 'tapis', - 'homeDir': '/work/{tasdir}', - 'icon': None, + 'homeDir': '/scratch1/{tasdir}', + 'icon': None }, { 'name': 'My Data (Frontera)',