Skip to content

Commit 380693d

Browse files
committed
Merge branch 'idc-test' of https://github.com/ImagingDataCommons/IDC-Common into idc-prod-sp
2 parents c8d0a2b + 8c2f00c commit 380693d

File tree

3 files changed

+34
-78
lines changed

3 files changed

+34
-78
lines changed

accounts/urls.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323

2424
urlpatterns = [
25-
re_path(r'^', include(google_urls)),
26-
re_path(r'^', include(allauth_urls)),
25+
# re_path(r'^', include(google_urls)),
26+
# re_path(r'^', include(allauth_urls)),
2727
re_path(r'^logout', views.extended_logout_view, name='account_logout'),
2828
]

cohorts/urls.py

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -20,49 +20,48 @@
2020

2121

2222
urlpatterns = [
23-
re_path(r'^$', views.cohorts_list, name='cohort_list'),
23+
# re_path(r'^$', views.cohorts_list, name='cohort_list'),
2424
re_path(r'^manifests/fetch/(?P<file_name>[A-Za-z\-0-9]+\/manifest_(cohort_)?[0-9_]+(aws|gcs|gcp)?\.(s5cmd|json|csv|tsv))', views.fetch_user_manifest, name='fetch_user_manifest'),
2525
re_path(r'^manifests/check/(?P<file_name>[A-Za-z\-0-9]+\/manifest_(cohort_)?[0-9_]+(aws|gcs|gcp)?\.(s5cmd|json|csv|tsv))', views.check_manifest_ready, name='check_user_manifest'),
2626
re_path(r'^manifests/fetch/$', views.fetch_user_manifest, name='fetch_user_manifest_base'),
2727
re_path(r'^manifests/check/$', views.check_manifest_ready, name='check_user_manifest_base'),
28-
re_path(r'^api/$', views.views_api_v1.cohort_list_api, name='cohort_list_api'),
29-
re_path(r'^api/v1/$', views.views_api_v1.cohort_list_api, name='cohort_list_api'),
30-
re_path(r'^api/v2/$', views.views_api_v2.cohort_list_api, name='cohort_list_api'),
31-
# re_path(r'^api/preview/$', views.cohort_preview_api, name='cohort_preview_api'),
28+
# re_path(r'^api/$', views.views_api_v1.cohort_list_api, name='cohort_list_api'),
29+
# re_path(r'^api/v1/$', views.views_api_v1.cohort_list_api, name='cohort_list_api'),
30+
# re_path(r'^api/v2/$', views.views_api_v2.cohort_list_api, name='cohort_list_api'),
31+
# re_path(r'^api/preview/$', views.cohort_preview_api, name='cohort_preview_api'),
3232
re_path(r'^api/preview/manifest/$', views.views_api_v1.cohort_preview_manifest_api, name='cohort_preview_manifest_api'),
3333
re_path(r'^api/v1/preview/manifest/$', views.views_api_v1.cohort_preview_manifest_api, name='cohort_preview_manifest_api'),
3434
# re_path(r'^api/v2/preview/manifest/$', views.views_api_v2.cohort_preview_manifest_api, name='cohort_preview_manifest_api'),
3535
re_path(r'^api/preview/query/$', views.views_api_v1.cohort_preview_query_api, name='cohort_preview_query_api'),
3636
re_path(r'^api/v1/preview/query/$', views.views_api_v1.cohort_preview_query_api, name='cohort_preview_query_api'),
3737
re_path(r'^api/v2/preview/query/$', views.views_api_v2.cohort_preview_query_api, name='cohort_preview_query_api'),
38-
re_path(r'^(?P<cohort_id>\d+)/$', views.cohort_detail, name='cohort_details'),
39-
# re_path(r'^api/(?P<cohort_id>\d+)/$', views.cohort_detail_api, name='cohort_detail_api'),
40-
re_path(r'^(?P<cohort_id>\d+)/stats/$', views.get_cohort_stats, name='cohort_stats'),
38+
# re_path(r'^(?P<cohort_id>\d+)/$', views.cohort_detail, name='cohort_details'),
39+
# re_path(r'^api/(?P<cohort_id>\d+)/$', views.cohort_detail_api, name='cohort_detail_api'),
40+
# re_path(r'^(?P<cohort_id>\d+)/stats/$', views.get_cohort_stats, name='cohort_stats'),
4141

42-
# re_path(r'^api/(?P<cohort_id>\d+)/$', views.cohort_detail_api, name='cohort_detail_api'),
43-
re_path(r'^api/(?P<cohort_id>\d+)/manifest/$', views.views_api_v1.cohort_manifest_api, name='cohort_manifest_api'),
44-
re_path(r'^api/v1/(?P<cohort_id>\d+)/manifest/$', views.views_api_v1.cohort_manifest_api, name='cohort_manifest_api'),
42+
# re_path(r'^api/(?P<cohort_id>\d+)/$', views.cohort_detail_api, name='cohort_detail_api'),
43+
# re_path(r'^api/(?P<cohort_id>\d+)/manifest/$', views.views_api_v1.cohort_manifest_api, name='cohort_manifest_api'),
44+
# re_path(r'^api/v1/(?P<cohort_id>\d+)/manifest/$', views.views_api_v1.cohort_manifest_api, name='cohort_manifest_api'),
4545
# re_path(r'^api/v2/(?P<cohort_id>\d+)/manifest/$', views.views_api_v2.cohort_manifest_api, name='cohort_manifest_api'),
46-
re_path(r'^api/(?P<cohort_id>\d+)/query/$', views.views_api_v1.cohort_query_api, name='cohort_query_api'),
47-
re_path(r'^api/v1/(?P<cohort_id>\d+)/query/$', views.views_api_v1.cohort_query_api, name='cohort_query_api'),
48-
re_path(r'^api/v2/(?P<cohort_id>\d+)/query/$', views.views_api_v2.cohort_query_api, name='cohort_query_api'),
49-
re_path(r'^save_cohort/', views.save_cohort, name='save_cohort'),
50-
re_path(r'^api/save_cohort/', views.views_api_v1.save_cohort_api, name='save_cohort_api'),
51-
re_path(r'^api/v1/save_cohort/', views.views_api_v1.save_cohort_api, name='save_cohort_api'),
52-
re_path(r'^api/v2/save_cohort/', views.views_api_v2.save_cohort_api, name='save_cohort_api'),
53-
re_path(r'^delete_cohort/', views.delete_cohort, name='delete_cohort'),
54-
re_path(r'^api/delete_cohort/', views.views_api_v1.delete_cohort_api, name='delete_cohort_api'),
55-
re_path(r'^api/v1/delete_cohort/', views.views_api_v1.delete_cohort_api, name='delete_cohort_api'),
56-
re_path(r'^api/v2/delete_cohort/', views.views_api_v2.delete_cohort_api, name='delete_cohort_api'),
57-
#re_path(r'^clone_cohort/(?P<cohort_id>\d+)/', views.clone_cohort, name='clone_cohort'),
58-
#re_path(r'^share_cohort/$', views.share_cohort, name='share_cohorts'),
59-
#re_path(r'^share_cohort/(?P<cohort_id>\d+)/', views.share_cohort, name='share_cohort'),
60-
#re_path(r'^unshare_cohort/$', views.unshare_cohort, name='unshare_cohorts'),
61-
#re_path(r'^unshare_cohort/(?P<cohort_id>\d+)/', views.unshare_cohort, name='unshare_cohort'),
62-
#re_path(r'^set_operation/', views.set_operation, name='set_operation'),
63-
#re_path(r'^save_cohort_comment/', views.save_comment, name='save_cohort_comment'),
64-
re_path(r'^download_manifest/(?P<cohort_id>\d+)/', views.download_cohort_manifest, name='cohort_manifest'),
65-
re_path(r'bq_string/(?P<cohort_id>\d+)/', views.get_query_str_response, name='bq_string'),
66-
re_path(r'^download_manifest/', views.download_cohort_manifest, name='cohort_manifest_base'),
67-
re_path(r'^get_metadata_ajax/$', views.get_metadata, name='metadata_count_ajax')
46+
# re_path(r'^api/(?P<cohort_id>\d+)/query/$', views.views_api_v1.cohort_query_api, name='cohort_query_api'),
47+
# re_path(r'^api/v1/(?P<cohort_id>\d+)/query/$', views.views_api_v1.cohort_query_api, name='cohort_query_api'),
48+
# re_path(r'^api/v2/(?P<cohort_id>\d+)/query/$', views.views_api_v2.cohort_query_api, name='cohort_query_api'),
49+
# re_path(r'^save_cohort/', views.save_cohort, name='save_cohort'),
50+
# re_path(r'^api/save_cohort/', views.views_api_v1.save_cohort_api, name='save_cohort_api'),
51+
# re_path(r'^api/v1/save_cohort/', views.views_api_v1.save_cohort_api, name='save_cohort_api'),
52+
# re_path(r'^api/v2/save_cohort/', views.views_api_v2.save_cohort_api, name='save_cohort_api'),
53+
# re_path(r'^delete_cohort/', views.delete_cohort, name='delete_cohort'),
54+
# re_path(r'^api/delete_cohort/', views.views_api_v1.delete_cohort_api, name='delete_cohort_api'),
55+
# re_path(r'^api/v1/delete_cohort/', views.views_api_v1.delete_cohort_api, name='delete_cohort_api'),
56+
# re_path(r'^api/v2/delete_cohort/', views.views_api_v2.delete_cohort_api, name='delete_cohort_api'),
57+
# re_path(r'^clone_cohort/(?P<cohort_id>\d+)/', views.clone_cohort, name='clone_cohort'),
58+
# re_path(r'^share_cohort/$', views.share_cohort, name='share_cohorts'),
59+
# re_path(r'^share_cohort/(?P<cohort_id>\d+)/', views.share_cohort, name='share_cohort'),
60+
# re_path(r'^unshare_cohort/$', views.unshare_cohort, name='unshare_cohorts'),
61+
# re_path(r'^unshare_cohort/(?P<cohort_id>\d+)/', views.unshare_cohort, name='unshare_cohort'),
62+
# re_path(r'^set_operation/', views.set_operation, name='set_operation'),
63+
# re_path(r'^save_cohort_comment/', views.save_comment, name='save_cohort_comment'),
64+
# re_path(r'^download_manifest/(?P<cohort_id>\d+)/', views.download_cohort_manifest, name='cohort_manifest'),
65+
# re_path(r'bq_string/(?P<cohort_id>\d+)/', views.get_query_str_response, name='bq_string'),
66+
# re_path(r'^download_manifest/', views.download_cohort_manifest, name='cohort_manifest_base'),
6867
]

cohorts/views/views.py

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -662,46 +662,3 @@ def get_query_string(request, cohort_id=0):
662662
logger.exception(e)
663663

664664
return query
665-
666-
667-
@login_required
668-
@cache_page(60 * 15)
669-
def get_metadata(request):
670-
filters = json.loads(request.GET.get('filters', '{}'))
671-
comb_mut_filters = request.GET.get('mut_filter_combine', 'OR')
672-
cohort = request.GET.get('cohort_id', None)
673-
limit = request.GET.get('limit', None)
674-
program_id = request.GET.get('program_id', None)
675-
676-
program_id = int(program_id) if program_id is not None else None
677-
678-
user = Django_User.objects.get(id=request.user.id)
679-
680-
if program_id is not None and program_id > 0:
681-
results = public_metadata_counts(filters[str(program_id)], cohort, user, program_id, limit, comb_mut_filters=comb_mut_filters)
682-
683-
# If there is an extent cohort, to get the cohort's new totals per applied filters
684-
# we have to check the unfiltered programs for their numbers and tally them in
685-
# This includes user data!
686-
if cohort:
687-
results['cohort-total'] = results['total']
688-
results['cohort-cases'] = results['cases']
689-
cohort_pub_progs = Program.objects.filter(id__in=Collection.objects.filter(id__in=Samples.objects.filter(cohort_id=cohort).values_list('project_id',flat=True).distinct()).values_list('program_id',flat=True).distinct(), is_public=True)
690-
for prog in cohort_pub_progs:
691-
if prog.id != program_id:
692-
prog_res = public_metadata_counts(filters[str(prog.id)], cohort, user, prog.id, limit)
693-
results['cohort-total'] += prog_res['total']
694-
results['cohort-cases'] += prog_res['cases']
695-
696-
cohort_user_progs = Program.objects.filter(id__in=Collection.objects.filter(id__in=Samples.objects.filter(cohort_id=cohort).values_list('project_id',flat=True).distinct()).values_list('program_id', flat=True).distinct(), is_public=False)
697-
for prog in cohort_user_progs:
698-
user_prog_res = user_metadata_counts(user, {'0': {'user_program', [prog.id]}}, cohort)
699-
results['cohort-total'] += user_prog_res['total']
700-
results['cohort-cases'] += user_prog_res['cases']
701-
else:
702-
results = user_metadata_counts(user, filters, cohort)
703-
704-
if not results:
705-
results = {}
706-
707-
return JsonResponse(results)

0 commit comments

Comments
 (0)