Skip to content

Commit fd13a22

Browse files
authored
Merge pull request #415 from ImagingDataCommons/idc-prod-sp
Release 46 / v21
2 parents 83f5857 + 380693d commit fd13a22

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+939
-1753
lines changed

accounts/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
from datetime import datetime, timezone, timedelta
2525
import pytz
2626

27-
logger = logging.getLogger('main_logger')
27+
logger = logging.getLogger(__name__)
2828

2929

3030
def utc_now_plus_expiry():

accounts/service_obj.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
from jsonschema import validate as schema_validate, ValidationError
2525

26-
logger = logging.getLogger('main_logger')
26+
logger = logging.getLogger(__name__)
2727

2828
class ServiceObjectBase(object):
2929
"""

accounts/urls.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414
# limitations under the License.
1515
#
1616

17-
from django.conf.urls import url, include
17+
from django.urls import include, re_path, path
1818
from allauth import urls as allauth_urls
1919
from allauth.socialaccount.providers.google import urls as google_urls, views as google_views
2020

2121
from . import views
2222

2323

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

accounts/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
from .models import *
2828

29-
logger = logging.getLogger('main_logger')
29+
logger = logging.getLogger(__name__)
3030

3131

3232
@login_required

cohorts/decorators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from django.http import JsonResponse
2323

2424
import logging
25-
logger = logging.getLogger('main_logger')
25+
logger = logging.getLogger(__name__)
2626

2727

2828
# Adapted from the Django REST Framework's TokenAuthentization class

cohorts/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
from functools import reduce
3636
from google_helpers.bigquery.bq_support import BigQuerySupport
3737

38-
logger = logging.getLogger('main_logger')
38+
logger = logging.getLogger(__name__)
3939

4040

4141
class CohortQuerySet(models.QuerySet):

cohorts/urls.py

Lines changed: 44 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -15,55 +15,53 @@
1515
#
1616
from __future__ import absolute_import
1717

18-
from django.conf.urls import url
18+
from django.urls import include, re_path, path
1919
from . import views
2020

2121

2222
urlpatterns = [
23-
url(r'^$', views.cohorts_list, name='cohort_list'),
24-
url(r'^manifests/fetch/(?P<file_name>[A-Za-z\-0-9]+\/manifest_[0-9_]+(aws|gcs|gcp)\.s5cmd)', views.fetch_user_manifest, name='fetch_user_manifest'),
25-
url(r'^manifests/check/(?P<file_name>[A-Za-z\-0-9]+\/manifest_[0-9_]+(aws|gcs|gcp)\.s5cmd)', views.check_manifest_ready, name='check_user_manifest'),
26-
url(r'^manifests/fetch/$', views.fetch_user_manifest, name='fetch_user_manifest_base'),
27-
url(r'^manifests/check/$', views.check_manifest_ready, name='check_user_manifest_base'),
28-
url(r'^api/$', views.views_api_v1.cohort_list_api, name='cohort_list_api'),
29-
url(r'^api/v1/$', views.views_api_v1.cohort_list_api, name='cohort_list_api'),
30-
url(r'^api/v2/$', views.views_api_v2.cohort_list_api, name='cohort_list_api'),
31-
# url(r'^api/preview/$', views.cohort_preview_api, name='cohort_preview_api'),
32-
url(r'^api/preview/manifest/$', views.views_api_v1.cohort_preview_manifest_api, name='cohort_preview_manifest_api'),
33-
url(r'^api/v1/preview/manifest/$', views.views_api_v1.cohort_preview_manifest_api, name='cohort_preview_manifest_api'),
34-
# url(r'^api/v2/preview/manifest/$', views.views_api_v2.cohort_preview_manifest_api, name='cohort_preview_manifest_api'),
35-
url(r'^api/preview/query/$', views.views_api_v1.cohort_preview_query_api, name='cohort_preview_query_api'),
36-
url(r'^api/v1/preview/query/$', views.views_api_v1.cohort_preview_query_api, name='cohort_preview_query_api'),
37-
url(r'^api/v2/preview/query/$', views.views_api_v2.cohort_preview_query_api, name='cohort_preview_query_api'),
38-
url(r'^(?P<cohort_id>\d+)/$', views.cohort_detail, name='cohort_details'),
39-
# url(r'^api/(?P<cohort_id>\d+)/$', views.cohort_detail_api, name='cohort_detail_api'),
40-
url(r'^(?P<cohort_id>\d+)/stats/$', views.get_cohort_stats, name='cohort_stats'),
23+
# re_path(r'^$', views.cohorts_list, name='cohort_list'),
24+
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'),
25+
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'),
26+
re_path(r'^manifests/fetch/$', views.fetch_user_manifest, name='fetch_user_manifest_base'),
27+
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'),
32+
re_path(r'^api/preview/manifest/$', views.views_api_v1.cohort_preview_manifest_api, name='cohort_preview_manifest_api'),
33+
re_path(r'^api/v1/preview/manifest/$', views.views_api_v1.cohort_preview_manifest_api, name='cohort_preview_manifest_api'),
34+
# re_path(r'^api/v2/preview/manifest/$', views.views_api_v2.cohort_preview_manifest_api, name='cohort_preview_manifest_api'),
35+
re_path(r'^api/preview/query/$', views.views_api_v1.cohort_preview_query_api, name='cohort_preview_query_api'),
36+
re_path(r'^api/v1/preview/query/$', views.views_api_v1.cohort_preview_query_api, name='cohort_preview_query_api'),
37+
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'),
4141

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

cohorts/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
from idc_collections.collex_metadata_utils import get_collex_metadata, filter_manifest
3737
from idc_collections.models import DataSetType,DataSource
3838

39-
logger = logging.getLogger('main_logger')
39+
logger = logging.getLogger(__name__)
4040
DENYLIST_RE = settings.DENYLIST_RE
4141

4242

@@ -142,7 +142,7 @@ def _save_cohort(user, filters=None, name=None, cohort_id=None, version=None, de
142142

143143
cohort_details = {}
144144
if name or desc:
145-
denylist = re.compile(DENYLIST_RE, re.UNICODE)
145+
denylist = re.compile(DENYLIST_RE, re.UNICODE|re.IGNORECASE)
146146
check = {'name': {'val': name, 'match': denylist.search(str(name))},
147147
'description': {'val': desc, 'match': denylist.search(str(desc))}}
148148
if len([check[x]['match'] for x in check if check[x]['match'] is not None]):

cohorts/utils_api_v1.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from google_helpers.bigquery.bq_support import BigQuerySupport
2626

2727

28-
logger = logging.getLogger('main_logger')
28+
logger = logging.getLogger(__name__)
2929
DENYLIST_RE = settings.DENYLIST_RE
3030

3131
# Get the current if none specified

cohorts/utils_api_v2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from idc_collections.models import ImagingDataCommonsVersion
2323
from idc_collections.collex_metadata_utils import get_bq_metadata, get_bq_string
2424

25-
logger = logging.getLogger('main_logger')
25+
logger = logging.getLogger(__name__)
2626
DENYLIST_RE = settings.DENYLIST_RE
2727

2828
NUMERIC_OPS = ('_btw', '_ebtw', '_btwe', '_ebtwe', '_gte', '_lte', '_gt', '_lt', '_eq')

0 commit comments

Comments
 (0)