nci-cidc-api-modules 1.1.37__py3-none-any.whl → 1.1.38__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.
cidc_api/models/models.py CHANGED
@@ -357,6 +357,7 @@ class CIDCRole(EnumBaseClass):
357
357
  NCI_BIOBANK_USER = "nci-biobank-user"
358
358
  NETWORK_VIEWER = "network-viewer"
359
359
  PACT_USER = "pact-user"
360
+ CLINICAL_TRIAL_USER = "clinical-trial-user"
360
361
 
361
362
 
362
363
  ROLES = [role.value for role in CIDCRole]
@@ -3215,7 +3216,7 @@ def upload_manifest_json(
3215
3216
  * The updated trial metadata object is updated in the `TrialMetadata` table.
3216
3217
  """
3217
3218
  try:
3218
- TrialMetadata.patch_manifest(trial_id, md_patch, session=session, commit=False)
3219
+ TrialMetadata.patch_manifest(trial_id, md_patch, session=session, commit=True)
3219
3220
  except ValidationError as e:
3220
3221
  raise BadRequest(json_validation.format_validation_error(e)) from e
3221
3222
  except ValidationMultiError as e:
@@ -54,3 +54,37 @@ def format_common_preprocessed_file_response(file: PreprocessedFiles):
54
54
  "uploader_email": file.uploader_email,
55
55
  "date": file._created.isoformat(),
56
56
  }
57
+
58
+
59
+ # TODO Below functions approve_pending_file and delete_pending_files were copied from deleted clinical_data.py
60
+ # Consider re-implementing with pending files in clinical data file uploads, or remove
61
+ # def approve_pending_file(pending_file: FileStorage):
62
+ # original_filename = pending_file.file_name
63
+ # pending_gcs_path = pending_file.object_url
64
+ # try:
65
+ # new_gcs_path = gcloud_client.move_gcs_file(
66
+ # GOOGLE_CLINICAL_DATA_BUCKET, pending_gcs_path, f"{MASTER_APPENDIX_A}/"
67
+ # )
68
+ # except Exception as e:
69
+ # logger.error(str(e))
70
+ # raise InternalServerError(str(e))
71
+ # # Move any 'current' file(s) to 'archived' status
72
+ # latest_version = PreprocessedFiles.archive_current_files(MASTER_APPENDIX_A)
73
+ # # Insert new "approved" DB record
74
+ # PreprocessedFiles.create(
75
+ # file_name=original_filename,
76
+ # object_url=new_gcs_path,
77
+ # file_category=MASTER_APPENDIX_A,
78
+ # uploader_email=get_current_user().email,
79
+ # status="current",
80
+ # version=latest_version + 1,
81
+ # )
82
+ # # Delete pending record
83
+ # pending_file.delete()
84
+ # return new_gcs_path
85
+ #
86
+ #
87
+ # def delete_pending_files(pending_folder: str, file_category: str):
88
+ # """Deletes specified pending file(s) from GCS and associated db record(s)."""
89
+ # gcloud_client.delete_items_from_folder(GOOGLE_CLINICAL_DATA_BUCKET, pending_folder)
90
+ # PreprocessedFiles.delete_pending_files_by_category(file_category)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nci_cidc_api_modules
3
- Version: 1.1.37
3
+ Version: 1.1.38
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
@@ -5,7 +5,7 @@ cidc_api/config/secrets.py,sha256=jRFj7W43pWuPf9DZQLCKF7WPXf5cUv-BAaS3ASqhV_Q,14
5
5
  cidc_api/config/settings.py,sha256=mA-4r7oB60uFepYtl5abbPigjwX8aBz__qCJXdcWWbs,4272
6
6
  cidc_api/models/__init__.py,sha256=bl445G8Zic9YbhZ8ZBni07wtBMhLJRMBA-JqjLxx2bw,66
7
7
  cidc_api/models/migrations.py,sha256=gp9vtkYbA9FFy2s-7woelAmsvQbJ41LO2_DY-YkFIrQ,11464
8
- cidc_api/models/models.py,sha256=u2SA3R0xaVgdoU8nnnl2dptt_hMtkdgQcmZhdEQbLv4,141631
8
+ cidc_api/models/models.py,sha256=D4GmcQSLKGBi0k3-w3TZk7J46zKR80JViN2_vTBZ1ZQ,141678
9
9
  cidc_api/models/schemas.py,sha256=6IE2dJoEMcMbi0Vr1V3cYKnPKU0hv9vRKBixOZHe88s,2766
10
10
  cidc_api/models/files/__init__.py,sha256=8BMTnUSHzUbz0lBeEQY6NvApxDD3GMWMduoVMos2g4Y,213
11
11
  cidc_api/models/files/details.py,sha256=sZkGM7iEV4-J6IDQCdiMV6KBDLbPxCOqUMaU3aY9rX8,65153
@@ -13,12 +13,12 @@ cidc_api/models/files/facets.py,sha256=WqjfqtYJgY2tBnZ598Yc0eJdQUo2slFNLyTDaqPx_
13
13
  cidc_api/shared/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
14
  cidc_api/shared/auth.py,sha256=PHqmVGkqDjbmUofytVFwD_9ssgUomESl3fFtFHPwZYQ,9062
15
15
  cidc_api/shared/emails.py,sha256=HQIixEUsR8yyu7Iv8S81RjtvEQeGuzQHzBfGsWIfP7k,4961
16
- cidc_api/shared/file_handling.py,sha256=z9Fza4PNTQ2U2VgMEiwx-Xpsp1AKgJuBugEl8loglec,2334
16
+ cidc_api/shared/file_handling.py,sha256=lbdY4XH-otpNjWDY1g6EQoVWtEYM_9j95OlQXeeFkhE,3808
17
17
  cidc_api/shared/gcloud_client.py,sha256=tgi6Ja31EUQcJueAIYHc3VyrMchoMZCdui1eruakCLg,36351
18
18
  cidc_api/shared/jose.py,sha256=-qzGzEDAlokEp9E7WtBtQkXyyfPWTYXlwYpCqVJWmqM,1830
19
19
  cidc_api/shared/rest_utils.py,sha256=RwR30WOUAYCxL7V-i2totEyeriG30GbBDvBcpLXhM9w,6594
20
- nci_cidc_api_modules-1.1.37.dist-info/licenses/LICENSE,sha256=pNYWVTHaYonnmJyplmeAp7tQAjosmDpAWjb34jjv7Xs,1102
21
- nci_cidc_api_modules-1.1.37.dist-info/METADATA,sha256=lkOyyerechLmU60nEzlIxONbexRRnvVbB1T1qApjjtM,41284
22
- nci_cidc_api_modules-1.1.37.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
23
- nci_cidc_api_modules-1.1.37.dist-info/top_level.txt,sha256=rNiRzL0lJGi5Q9tY9uSoMdTbJ-7u5c_D2E86KA94yRA,9
24
- nci_cidc_api_modules-1.1.37.dist-info/RECORD,,
20
+ nci_cidc_api_modules-1.1.38.dist-info/licenses/LICENSE,sha256=pNYWVTHaYonnmJyplmeAp7tQAjosmDpAWjb34jjv7Xs,1102
21
+ nci_cidc_api_modules-1.1.38.dist-info/METADATA,sha256=Vlhx5ZliL-b3-3Umhqm1q22BztzUG-mc2dTIyyHzZ24,41284
22
+ nci_cidc_api_modules-1.1.38.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
23
+ nci_cidc_api_modules-1.1.38.dist-info/top_level.txt,sha256=rNiRzL0lJGi5Q9tY9uSoMdTbJ-7u5c_D2E86KA94yRA,9
24
+ nci_cidc_api_modules-1.1.38.dist-info/RECORD,,