Skip to content

Commit 1666740

Browse files
authored
Merge pull request #172 from isb-cgc/prod-sp
Sprint 18
2 parents 6b62f6d + 08209fc commit 1666740

File tree

5 files changed

+12
-49
lines changed

5 files changed

+12
-49
lines changed

api_3/isb_cgc_api_CCLE/users_get.py

Lines changed: 0 additions & 32 deletions
This file was deleted.

api_3/patients_get_helper.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,21 +39,23 @@ def build_queries(self, program, genomic_builds):
3939

4040
sample_query_str = 'select sample_barcode ' \
4141
'from {}_metadata_biospecimen ' \
42-
'where case_barcode=%s'.format(program)
42+
'where case_barcode=%s ' \
43+
'group by sample_barcode ' \
44+
'order by sample_barcode'.format(program)
4345

4446
aliquot_query_str = ''
4547
for genomic_build in genomic_builds:
4648
part_aliquot_query_str = 'select aliquot_barcode ' \
4749
'from {}_metadata_data_{} ' \
4850
'where case_barcode=%s and aliquot_barcode is not null ' \
49-
'group by aliquot_barcode'.format(program, genomic_build)
51+
'group by aliquot_barcode ' \
52+
'order by aliquot_barcode'.format(program, genomic_build)
5053
if 0 < len(aliquot_query_str):
5154
aliquot_query_str += ' union '
5255
aliquot_query_str += part_aliquot_query_str
5356

5457
return clinical_query_str, sample_query_str, aliquot_query_str
5558

56-
5759
class CasesGetHelper(remote.Service):
5860

5961
GET_RESOURCE = endpoints.ResourceContainer(case_barcode=messages.StringField(1, required=True))

api_3/users_get_common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def get(self, program):
7070
allowed = True
7171
if not allowed:
7272
das = DatasetAccessSupportFactory.from_webapp_django_settings()
73-
authorized_datasets = das.get_datasets_for_era_login(user_email)
73+
authorized_datasets = das.get_datasets_for_era_login(nih_user.NIH_username)
7474
for dataset in authorized_datasets:
7575
try:
7676
ad = AuthorizedDataset.objects.get(whitelist_id=dataset.dataset_id)

cgc_api.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
from api_3.isb_cgc_api_CCLE.patients_get import CCLE_CasesGetAPI
4545
from api_3.isb_cgc_api_CCLE.samples_get import CCLE_SamplesGetAPI
4646
from api_3.isb_cgc_api_CCLE.samples_cloudstoragefilepaths import CCLE_SamplesCloudStorageFilePathsAPI
47-
from api_3.isb_cgc_api_CCLE.users_get import CCLE_UserGetAPI
4847

4948
package = 'isb-cgc-api'
5049

@@ -75,7 +74,6 @@
7574
CCLE_CohortsCreateAPI,
7675
CCLE_CasesGetAPI,
7776
CCLE_SamplesGetAPI,
78-
CCLE_SamplesCloudStorageFilePathsAPI,
79-
CCLE_UserGetAPI
77+
CCLE_SamplesCloudStorageFilePathsAPI
8078
])
8179

settings.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,16 @@
2323
os.environ.get('ALLOWED_HOST')
2424
]
2525

26-
### check if we are running in app engine
26+
### Check what we're running in
27+
APP_ENGINE_FLEX = 'aef-'
2728
APP_ENGINE = 'Google App Engine/'
29+
IS_APP_ENGINE_FLEX = os.getenv('GAE_INSTANCE', '').startswith(APP_ENGINE_FLEX)
2830
IS_APP_ENGINE = os.getenv('SERVER_SOFTWARE', '').startswith(APP_ENGINE)
31+
IS_DEV = bool(os.environ.get('IS_DEV', False))
2932

3033
### added for connecting to CloudSQL with SSL certs on MVM platform
3134
SSL_DIR = os.path.abspath(os.path.dirname(__file__))+os.sep
3235

33-
APP_ENGINE = 'ae-'
34-
IS_APP_ENGINE = os.getenv('GAE_INSTANCE', '').startswith(APP_ENGINE)
3536

3637
#ADMINS = (
3738
# ('Your Name', 'your_email@example.com'),
@@ -45,7 +46,6 @@
4546

4647
BASE_URL = os.environ.get('CLOUD_BASE_URL')
4748
BASE_API_URL = os.environ.get('CLOUD_API_URL')
48-
SITE_ID = 4
4949

5050
# Compute services
5151
PAIRWISE_SERVICE_URL = os.environ.get('PAIRWISE_SERVICE_URL')
@@ -63,8 +63,6 @@
6363

6464
NIH_AUTH_ON = os.environ.get('NIH_AUTH_ON', False)
6565

66-
IS_DEV = os.environ.get('IS_DEV', False)
67-
6866
DATABASES = {
6967
'default': {
7068
'ENGINE': os.environ.get('DATABASE_ENGINE', 'django.db.backends.mysql'),
@@ -86,17 +84,14 @@
8684

8785
DB_SOCKET = DATABASES['default']['HOST'] if 'cloudsql' in DATABASES['default']['HOST'] else None
8886

89-
IS_DEV = bool(os.environ.get('IS_DEV', False))
90-
9187
# Default to localhost for the site ID
9288
SITE_ID = 3
9389

94-
if IS_APP_ENGINE:
90+
if IS_APP_ENGINE_FLEX or IS_APP_ENGINE:
9591
print >> sys.stdout, "[STATUS] AppEngine detected."
9692
SITE_ID = 4
9793

9894
# For running local unit tests for models
99-
import sys
10095
if 'test' in sys.argv:
10196
DATABASES = os.environ.get('TEST_DATABASE')
10297

0 commit comments

Comments
 (0)