Skip to content

Commit

Permalink
handle missing default system; enable work as default system locally (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
rstijerina authored Sep 29, 2023
1 parent 66d4f6d commit 033f8a6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion client/src/components/Applications/AppForm/AppForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion server/portal/apps/datafiles/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
2 changes: 1 addition & 1 deletion server/portal/settings/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
13 changes: 6 additions & 7 deletions server/portal/settings/settings_default.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)',
Expand Down

0 comments on commit 033f8a6

Please sign in to comment.