Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

task/WP-834 - Add behavior for ignoring DesignSafe-Corral allocation for running jobs #1057

Merged
merged 3 commits into from
Feb 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions server/portal/apps/users/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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})


Expand Down
4 changes: 4 additions & 0 deletions server/portal/settings/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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', '')
Expand Down