Skip to content

Commit

Permalink
Remove temporary datathon management code (#2171)
Browse files Browse the repository at this point in the history
This PR removes the code introduced in PR #1987, which provided a
temporary solution for a Datathon in Spain—specifically, a JSON file
of AWS user accounts available for download by administrators.
  • Loading branch information
Benjamin Moody committed Dec 22, 2023
2 parents 619e343 + b8b3557 commit b237a98
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 35 deletions.
2 changes: 0 additions & 2 deletions physionet-django/console/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@
path('users/groups/', views.user_groups, name='user_groups'),
path('users/groups/<group>/', views.user_group, name='user_group'),
path('users/<group>/', views.users, name='users'),
path('users/aws-access-list.json', views.users_aws_access_list_json,
name='users_aws_access_list_json'),
path('user/manage/<username>/', views.user_management,
name='user_management'),

Expand Down
33 changes: 0 additions & 33 deletions physionet-django/console/views.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import csv
import logging
import os
import re
from collections import OrderedDict
from datetime import datetime
from itertools import chain
Expand Down Expand Up @@ -1304,38 +1303,6 @@ def users_search(request, group):
raise Http404()


@console_permission_required('user.view_user')
def users_aws_access_list_json(request):
"""
Generate JSON list of currently authorized AWS accounts.
This is a temporary kludge to support an upcoming event (November
2022). Don't rely on this function; it will go away.
"""
projects_datathon = [
"mimiciv-2.2"
]
published_projects = PublishedProject.objects.all()
users_with_awsid = User.objects.filter(cloud_information__aws_id__isnull=False)
datasets = {}
datasets['datasets'] = []
aws_id_pattern = r"\b\d{12}\b"

for project in published_projects:
dataset = {}
project_name = project.slug + "-" + project.version
if project_name in projects_datathon:
dataset['name'] = project_name
dataset['accounts'] = []
for user in users_with_awsid:
if can_view_project_files(project, user):
if re.search(aws_id_pattern, user.cloud_information.aws_id):
dataset['accounts'].append(user.cloud_information.aws_id)
datasets['datasets'].append(dataset)

return JsonResponse(datasets)


@console_permission_required('user.change_credentialapplication')
def known_references_search(request):
"""
Expand Down

0 comments on commit b237a98

Please sign in to comment.