nci-cidc-api-modules 1.1.20__py3-none-any.whl → 1.1.22__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -95,11 +95,13 @@ if not TESTING:
95
95
  CSMS_TOKEN_URL = secret_manager.get(environ.get("CSMS_TOKEN_URL_ID"))
96
96
  CSMS_CLIENT_SECRET = secret_manager.get(environ.get("CSMS_CLIENT_SECRET_ID"))
97
97
  CSMS_CLIENT_ID = secret_manager.get(environ.get("CSMS_CLIENT_ID_ID"))
98
+ IS_EMAIL_ON = secret_manager.get(environ.get("IS_EMAIL_ON_ID"))
98
99
  else:
99
100
  CSMS_BASE_URL = environ.get("CSMS_BASE_URL")
100
101
  CSMS_TOKEN_URL = environ.get("CSMS_TOKEN_URL")
101
102
  CSMS_CLIENT_SECRET = environ.get("CSMS_CLIENT_SECRET")
102
103
  CSMS_CLIENT_ID = environ.get("CSMS_CLIENT_ID")
104
+ IS_EMAIL_ON = environ.get("IS_EMAIL_ON")
103
105
 
104
106
 
105
107
  # Accumulate all constants defined in this file in a single dictionary
cidc_api/models/models.py CHANGED
@@ -2518,6 +2518,14 @@ class DownloadableFiles(CommonColumns):
2518
2518
 
2519
2519
  return clause
2520
2520
 
2521
+ @classmethod
2522
+ @with_default_session
2523
+ def list_ids(cls, session: Session, filter_: Callable[[Query], Query]):
2524
+ """List record ids in the downloadable_files table based on filter_."""
2525
+ query = session.query(cls.id)
2526
+ query = filter_(query)
2527
+ return [r[0] for r in query.all()]
2528
+
2521
2529
  @classmethod
2522
2530
  @with_default_session
2523
2531
  def list_with_permissions(
@@ -53,6 +53,7 @@ from ..config.settings import (
53
53
  GOOGLE_GRANT_DOWNLOAD_PERMISSIONS_TOPIC,
54
54
  TESTING,
55
55
  ENV,
56
+ IS_EMAIL_ON,
56
57
  DEV_CFUNCTIONS_SERVER,
57
58
  INACTIVE_USER_DAYS,
58
59
  )
@@ -898,7 +899,7 @@ def send_email(to_emails: List[str], subject: str, html_content: str, **kw) -> N
898
899
  `kw` are expected to be sendgrid json api style additional email parameters.
899
900
  """
900
901
  # Don't actually send an email if this is a test
901
- if TESTING or ENV == "dev":
902
+ if TESTING or ENV == "dev" or IS_EMAIL_ON.lower() == "false":
902
903
  logger.info(f"Would send email with subject '{subject}' to {to_emails}")
903
904
  return
904
905
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nci_cidc_api_modules
3
- Version: 1.1.20
3
+ Version: 1.1.22
4
4
  Summary: SQLAlchemy data models and configuration tools used in the NCI CIDC API
5
5
  Home-page: https://github.com/NCI-CIDC/cidc-api-gae
6
6
  License: MIT license
@@ -28,7 +28,7 @@ Requires-Dist: python-dotenv==0.10.3
28
28
  Requires-Dist: requests==2.32.3
29
29
  Requires-Dist: jinja2==3.1.6
30
30
  Requires-Dist: certifi==2024.7.4
31
- Requires-Dist: nci-cidc-schemas==0.27.13
31
+ Requires-Dist: nci-cidc-schemas==0.27.14
32
32
  Dynamic: description
33
33
  Dynamic: description-content-type
34
34
  Dynamic: home-page
@@ -2,13 +2,13 @@ cidc_api/config/__init__.py,sha256=5mX8GAPxUKV84iS-aGOoE-4m68LsOCGCDptXNdlgvj0,1
2
2
  cidc_api/config/db.py,sha256=cyWhWtmXha4OsrwUf6ez8aKSfm7tPSmPDE9JVSBx3Fk,1935
3
3
  cidc_api/config/logging.py,sha256=E-SdjOYTpfsml-YaBL7Mj2mUT60OTAHH2X6TdeJWasU,1038
4
4
  cidc_api/config/secrets.py,sha256=jRFj7W43pWuPf9DZQLCKF7WPXf5cUv-BAaS3ASqhV_Q,1481
5
- cidc_api/config/settings.py,sha256=p3YuGCH64S8pkdi_b5sDleVqXO6m7tZcDTd5EJnHlbE,4090
5
+ cidc_api/config/settings.py,sha256=fJQIaCfxsuooEi1pAO8FhHurN0BjP6FZKX8jl7uHGZM,4203
6
6
  cidc_api/csms/__init__.py,sha256=eJkY6rWNOAUBmSd4G1_U6h7i472druKEtBdVmgFZVPg,20
7
7
  cidc_api/csms/auth.py,sha256=VTfHlCym_hqVrHXv41Ku9RMAGN9BiNe7ui0o9KZCKtY,3185
8
8
  cidc_api/models/__init__.py,sha256=bl445G8Zic9YbhZ8ZBni07wtBMhLJRMBA-JqjLxx2bw,66
9
9
  cidc_api/models/csms_api.py,sha256=ovi_jZXZBg6XYEvIupbf5c0WyMbPi4V07OywbleKGqs,30737
10
10
  cidc_api/models/migrations.py,sha256=gp9vtkYbA9FFy2s-7woelAmsvQbJ41LO2_DY-YkFIrQ,11464
11
- cidc_api/models/models.py,sha256=tKLyBrVH_7fL2smGzApypBTyL-nuuXQHxI-TJsUAIMg,129200
11
+ cidc_api/models/models.py,sha256=mQ6XTnGwh-h8wi7xcwEuzMZUr8epv9C8f5lkjkIjsVc,129512
12
12
  cidc_api/models/schemas.py,sha256=7tDYtmULuzTt2kg7RorWhte06ffalgpQKrFiDRGcPEQ,2711
13
13
  cidc_api/models/files/__init__.py,sha256=8BMTnUSHzUbz0lBeEQY6NvApxDD3GMWMduoVMos2g4Y,213
14
14
  cidc_api/models/files/details.py,sha256=WrWPxJqlsteinoNbGTaQ3fcxgvChqLGJ9vY7H829jtk,62842
@@ -16,11 +16,11 @@ cidc_api/models/files/facets.py,sha256=JqCmwcjYYSz7XK4bAokSE9i71C8t9EQ4Jtbv7npth
16
16
  cidc_api/shared/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
17
  cidc_api/shared/auth.py,sha256=PHqmVGkqDjbmUofytVFwD_9ssgUomESl3fFtFHPwZYQ,9062
18
18
  cidc_api/shared/emails.py,sha256=GY-l0EkoVU_3hjV0g-xo7N9d1iyCdluyq_arftEPPe0,4989
19
- cidc_api/shared/gcloud_client.py,sha256=spgH0fapO713X82eV23uLXtq4aVWJHwEDK-XDxaehJc,33088
19
+ cidc_api/shared/gcloud_client.py,sha256=i4ZZLoDC_pEwKaMS8218uUJ0fsIi0DKwd-hzGHGQw7g,33139
20
20
  cidc_api/shared/jose.py,sha256=-qzGzEDAlokEp9E7WtBtQkXyyfPWTYXlwYpCqVJWmqM,1830
21
21
  cidc_api/shared/rest_utils.py,sha256=RwR30WOUAYCxL7V-i2totEyeriG30GbBDvBcpLXhM9w,6594
22
- nci_cidc_api_modules-1.1.20.dist-info/licenses/LICENSE,sha256=pNYWVTHaYonnmJyplmeAp7tQAjosmDpAWjb34jjv7Xs,1102
23
- nci_cidc_api_modules-1.1.20.dist-info/METADATA,sha256=9bKdEpLKTMkgZBHtB49TxLRu2vPlmohmy_cfwU35RMk,41285
24
- nci_cidc_api_modules-1.1.20.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
25
- nci_cidc_api_modules-1.1.20.dist-info/top_level.txt,sha256=rNiRzL0lJGi5Q9tY9uSoMdTbJ-7u5c_D2E86KA94yRA,9
26
- nci_cidc_api_modules-1.1.20.dist-info/RECORD,,
22
+ nci_cidc_api_modules-1.1.22.dist-info/licenses/LICENSE,sha256=pNYWVTHaYonnmJyplmeAp7tQAjosmDpAWjb34jjv7Xs,1102
23
+ nci_cidc_api_modules-1.1.22.dist-info/METADATA,sha256=cqpP51JJJTi4J_3gNdZkj3cRL3NXcFm8UtXCgkcSvG0,41285
24
+ nci_cidc_api_modules-1.1.22.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
25
+ nci_cidc_api_modules-1.1.22.dist-info/top_level.txt,sha256=rNiRzL0lJGi5Q9tY9uSoMdTbJ-7u5c_D2E86KA94yRA,9
26
+ nci_cidc_api_modules-1.1.22.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.3.1)
2
+ Generator: setuptools (80.4.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5