Skip to content

Commit 669d149

Browse files
author
George
committed
allow study or series level download of cart for debug purposes
1 parent 3a71700 commit 669d149

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

idc/views.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
from cohorts.models import Cohort, Cohort_Perms
3838

3939
from idc_collections.models import Program, DataSource, Collection, ImagingDataCommonsVersion, Attribute, Attribute_Tooltips, DataSetType
40-
from idc_collections.collex_metadata_utils import build_explorer_context, get_collex_metadata, create_file_manifest, get_cart_data, get_cart_data_studylvl, get_table_data_with_cart_data
40+
from idc_collections.collex_metadata_utils import build_explorer_context, get_collex_metadata, create_file_manifest, get_cart_data_serieslvl, get_cart_data_studylvl, get_table_data_with_cart_data
4141
from allauth.socialaccount.models import SocialAccount
4242
from django.core.exceptions import ObjectDoesNotExist
4343
from django.http import HttpResponse, JsonResponse
@@ -1068,13 +1068,7 @@ def cart_data_stats(request):
10681068
mxseries = int(req.get('mxseries',1000))
10691069

10701070
response = get_cart_and_filterset_stats(current_filters,filtergrp_list, partitions, limit, offset, length, mxseries, results_lvl=results_level)
1071-
'''if ((len(partitions)>0) and (aggregate_level == 'StudyInstanceUID')):
1072-
response = get_cart_data_studylvl(filtergrp_list, partitions, limit, offset, length, mxseries, results_lvl=results_level)
1073-
elif ((len(partitions)>0) and (aggregate_level == 'SeriesInstanceUID')):
1074-
response = get_cart_data(filtergrp_list, partitions, field_list, limit, offset)
1075-
else:
1076-
response['numFound'] = 0
1077-
response['docs'] = []'''
1071+
10781072
except Exception as e:
10791073
logger.error("[ERROR] While loading cart:")
10801074
logger.exception(e)
@@ -1103,7 +1097,7 @@ def cart_data(request):
11031097
if ((len(partitions)>0) and (aggregate_level == 'StudyInstanceUID')):
11041098
response = get_cart_data_studylvl(filtergrp_list, partitions, limit, offset, length, mxseries, results_lvl=results_level)
11051099
elif ((len(partitions)>0) and (aggregate_level == 'SeriesInstanceUID')):
1106-
response = get_cart_data(filtergrp_list, partitions, field_list, limit, offset)
1100+
response = get_cart_data_serieslvl(filtergrp_list, partitions, field_list, limit, offset)
11071101
else:
11081102
response['numFound'] = 0
11091103
response['docs'] = []

static/js/cohorts/export-manifest.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,12 @@ require([
115115
$('#export-manifest-form').append('<input type="hidden" name="filtergrp_list">')
116116
$('#export-manifest-form').find('input[name="filtergrp_list"]').val(JSON.stringify(filtergrp_list));
117117
}
118+
if ($('#export-manifest-form').find('.debug').length==0){
119+
$('#export-manifest-form').append('<input type="hidden" name="debug" class="debug">')
120+
}
121+
$('#export-manifest-form').find('input[name="debug"]').val(window.lvl);
122+
123+
118124
$('#export-manifest-form').append('<input type="hidden" name="partitions">')
119125
$('#export-manifest-form').find('input[name="partitions"]').val(JSON.stringify(partitions));
120126
$('#export-manifest-form').append('<input type="hidden" name="mxstudies">')

0 commit comments

Comments
 (0)