diff --git a/server/portal/apps/users/views.py b/server/portal/apps/users/views.py index 3946233fe..486f46f0f 100644 --- a/server/portal/apps/users/views.py +++ b/server/portal/apps/users/views.py @@ -130,6 +130,11 @@ def get(self, request): """ data = get_allocations(request.user.username) + # This line iterates through all the projects in the active allocations and filters out the ones that are excluded in settings. + filtered_projects = [project for project in data["active"] if project.get("projectName") not in settings.ALLOCATIONS_TO_EXCLUDE] + + data["active"] = filtered_projects + return JsonResponse({"response": data}) diff --git a/server/portal/settings/settings.py b/server/portal/settings/settings.py index 09d7ef2d2..27dbb186e 100644 --- a/server/portal/settings/settings.py +++ b/server/portal/settings/settings.py @@ -607,6 +607,10 @@ def portal_filter(record): PORTAL_APPS_DEFAULT_TAB = getattr(settings_custom, '_PORTAL_APPS_DEFAULT_TAB', '') +ALLOCATIONS_TO_EXCLUDE = ( + getattr(settings_custom, "_ALLOCATIONS_TO_EXCLUDE", ["DesignSafe-DCV", "DesignSafe-Corral"]) +) + PORTAL_JOB_NOTIFICATION_STATES = ["PENDING", "STAGING_INPUTS", "RUNNING", "ARCHIVING", "BLOCKED", "PAUSED", "FINISHED", "CANCELLED", "FAILED"] WH_BASE_URL = getattr(settings_custom, '_WH_BASE_URL', '')