nci-cidc-api-modules 1.2.12__tar.gz → 1.2.14__tar.gz
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.
Potentially problematic release.
This version of nci-cidc-api-modules might be problematic. Click here for more details.
- nci_cidc_api_modules-1.2.14/MANIFEST.in +2 -0
- {nci_cidc_api_modules-1.2.12/nci_cidc_api_modules.egg-info → nci_cidc_api_modules-1.2.14}/PKG-INFO +1 -1
- {nci_cidc_api_modules-1.2.12 → nci_cidc_api_modules-1.2.14}/cidc_api/config/settings.py +4 -0
- nci_cidc_api_modules-1.2.14/cidc_api/shared/email_layout.html +258 -0
- {nci_cidc_api_modules-1.2.12 → nci_cidc_api_modules-1.2.14}/cidc_api/shared/emails.py +32 -2
- {nci_cidc_api_modules-1.2.12 → nci_cidc_api_modules-1.2.14/nci_cidc_api_modules.egg-info}/PKG-INFO +1 -1
- {nci_cidc_api_modules-1.2.12 → nci_cidc_api_modules-1.2.14}/nci_cidc_api_modules.egg-info/SOURCES.txt +1 -0
- {nci_cidc_api_modules-1.2.12 → nci_cidc_api_modules-1.2.14}/setup.py +1 -0
- nci_cidc_api_modules-1.2.12/MANIFEST.in +0 -1
- {nci_cidc_api_modules-1.2.12 → nci_cidc_api_modules-1.2.14}/LICENSE +0 -0
- {nci_cidc_api_modules-1.2.12 → nci_cidc_api_modules-1.2.14}/README.md +0 -0
- {nci_cidc_api_modules-1.2.12 → nci_cidc_api_modules-1.2.14}/cidc_api/config/__init__.py +0 -0
- {nci_cidc_api_modules-1.2.12 → nci_cidc_api_modules-1.2.14}/cidc_api/config/db.py +0 -0
- {nci_cidc_api_modules-1.2.12 → nci_cidc_api_modules-1.2.14}/cidc_api/config/logging.py +0 -0
- {nci_cidc_api_modules-1.2.12 → nci_cidc_api_modules-1.2.14}/cidc_api/config/secrets.py +0 -0
- {nci_cidc_api_modules-1.2.12 → nci_cidc_api_modules-1.2.14}/cidc_api/models/__init__.py +0 -0
- {nci_cidc_api_modules-1.2.12 → nci_cidc_api_modules-1.2.14}/cidc_api/models/files/__init__.py +0 -0
- {nci_cidc_api_modules-1.2.12 → nci_cidc_api_modules-1.2.14}/cidc_api/models/files/details.py +0 -0
- {nci_cidc_api_modules-1.2.12 → nci_cidc_api_modules-1.2.14}/cidc_api/models/files/facets.py +0 -0
- {nci_cidc_api_modules-1.2.12 → nci_cidc_api_modules-1.2.14}/cidc_api/models/migrations.py +0 -0
- {nci_cidc_api_modules-1.2.12 → nci_cidc_api_modules-1.2.14}/cidc_api/models/models.py +0 -0
- {nci_cidc_api_modules-1.2.12 → nci_cidc_api_modules-1.2.14}/cidc_api/models/schemas.py +0 -0
- {nci_cidc_api_modules-1.2.12 → nci_cidc_api_modules-1.2.14}/cidc_api/shared/__init__.py +0 -0
- {nci_cidc_api_modules-1.2.12 → nci_cidc_api_modules-1.2.14}/cidc_api/shared/auth.py +0 -0
- {nci_cidc_api_modules-1.2.12 → nci_cidc_api_modules-1.2.14}/cidc_api/shared/file_handling.py +0 -0
- {nci_cidc_api_modules-1.2.12 → nci_cidc_api_modules-1.2.14}/cidc_api/shared/gcloud_client.py +0 -0
- {nci_cidc_api_modules-1.2.12 → nci_cidc_api_modules-1.2.14}/cidc_api/shared/jose.py +0 -0
- {nci_cidc_api_modules-1.2.12 → nci_cidc_api_modules-1.2.14}/cidc_api/shared/rest_utils.py +0 -0
- {nci_cidc_api_modules-1.2.12 → nci_cidc_api_modules-1.2.14}/nci_cidc_api_modules.egg-info/dependency_links.txt +0 -0
- {nci_cidc_api_modules-1.2.12 → nci_cidc_api_modules-1.2.14}/nci_cidc_api_modules.egg-info/not-zip-safe +0 -0
- {nci_cidc_api_modules-1.2.12 → nci_cidc_api_modules-1.2.14}/nci_cidc_api_modules.egg-info/requires.txt +0 -0
- {nci_cidc_api_modules-1.2.12 → nci_cidc_api_modules-1.2.14}/nci_cidc_api_modules.egg-info/top_level.txt +0 -0
- {nci_cidc_api_modules-1.2.12 → nci_cidc_api_modules-1.2.14}/pyproject.toml +0 -0
- {nci_cidc_api_modules-1.2.12 → nci_cidc_api_modules-1.2.14}/requirements.modules.txt +0 -0
- {nci_cidc_api_modules-1.2.12 → nci_cidc_api_modules-1.2.14}/setup.cfg +0 -0
- {nci_cidc_api_modules-1.2.12 → nci_cidc_api_modules-1.2.14}/tests/test_api.py +0 -0
|
@@ -108,5 +108,9 @@ else:
|
|
|
108
108
|
IS_EMAIL_ON = environ.get("IS_EMAIL_ON")
|
|
109
109
|
|
|
110
110
|
|
|
111
|
+
# notification emails
|
|
112
|
+
CIDC_CLINICAL_DATA_EMAIL = environ.get("CIDC_CLINICAL_DATA_EMAIL")
|
|
113
|
+
CIDC_ADMIN_EMAIL = environ.get("CIDC_ADMIN_EMAIL")
|
|
114
|
+
|
|
111
115
|
# Accumulate all constants defined in this file in a single dictionary
|
|
112
116
|
SETTINGS = {k: v for k, v in globals().items() if k.isupper()}
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<title>Manifest Status Notification</title>
|
|
6
|
+
<meta charset="utf-8">
|
|
7
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
8
|
+
<meta http-equiv="Content-Type" content="text/html charset=UTF-8" />
|
|
9
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
|
10
|
+
<style type="text/css">
|
|
11
|
+
/* CLIENT-SPECIFIC STYLES */
|
|
12
|
+
body,
|
|
13
|
+
table,
|
|
14
|
+
td,
|
|
15
|
+
a {
|
|
16
|
+
-webkit-text-size-adjust: 100%;
|
|
17
|
+
-ms-text-size-adjust: 100%;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/* Prevent WebKit and Windows mobile changing default text sizes */
|
|
21
|
+
table,
|
|
22
|
+
td {
|
|
23
|
+
mso-table-lspace: 0pt;
|
|
24
|
+
mso-table-rspace: 0pt;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/* Remove spacing between tables in Outlook 2007 and up */
|
|
28
|
+
img {
|
|
29
|
+
-ms-interpolation-mode: bicubic;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* Allow smoother rendering of resized image in Internet Explorer */
|
|
33
|
+
|
|
34
|
+
/* RESET STYLES */
|
|
35
|
+
img {
|
|
36
|
+
border: 0;
|
|
37
|
+
height: auto;
|
|
38
|
+
line-height: 100%;
|
|
39
|
+
outline: none;
|
|
40
|
+
text-decoration: none;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
table {
|
|
44
|
+
border-collapse: collapse !important;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
body {
|
|
48
|
+
height: 100% !important;
|
|
49
|
+
margin: 0 !important;
|
|
50
|
+
padding: 0 !important;
|
|
51
|
+
width: 100% !important;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/* iOS BLUE LINKS */
|
|
55
|
+
a[x-apple-data-detectors] {
|
|
56
|
+
color: inherit !important;
|
|
57
|
+
text-decoration: none !important;
|
|
58
|
+
font-size: inherit !important;
|
|
59
|
+
font-family: inherit !important;
|
|
60
|
+
font-weight: inherit !important;
|
|
61
|
+
line-height: inherit !important;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/* MOBILE STYLES */
|
|
65
|
+
@media screen and (max-width: 525px) {
|
|
66
|
+
|
|
67
|
+
/* ALLOWS FOR FLUID TABLES */
|
|
68
|
+
.wrapper {
|
|
69
|
+
width: 100% !important;
|
|
70
|
+
max-width: 100% !important;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/* ADJUSTS LAYOUT OF LOGO IMAGE */
|
|
74
|
+
.logo img {
|
|
75
|
+
margin: 0 auto !important;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/* USE THESE CLASSES TO HIDE CONTENT ON MOBILE */
|
|
79
|
+
.mobile-hide {
|
|
80
|
+
display: none !important;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.img-max {
|
|
84
|
+
max-width: 100% !important;
|
|
85
|
+
width: 100% !important;
|
|
86
|
+
height: auto !important;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/* FULL-WIDTH TABLES */
|
|
90
|
+
.responsive-table {
|
|
91
|
+
width: 100% !important;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/* UTILITY CLASSES FOR ADJUSTING PADDING ON MOBILE */
|
|
95
|
+
.padding {
|
|
96
|
+
padding: 10px 5% 15px 5% !important;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.padding-meta {
|
|
100
|
+
padding: 30px 5% 0px 5% !important;
|
|
101
|
+
text-align: center;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.padding-copy {
|
|
105
|
+
padding: 10px 5% 10px 5% !important;
|
|
106
|
+
text-align: center;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.no-padding {
|
|
110
|
+
padding: 0 !important;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.section-padding {
|
|
114
|
+
padding: 50px 15px 50px 15px !important;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/* ADJUST BUTTONS ON MOBILE */
|
|
118
|
+
.mobile-button-container {
|
|
119
|
+
margin: 0 auto;
|
|
120
|
+
width: 100% !important;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.mobile-button {
|
|
124
|
+
padding: 15px !important;
|
|
125
|
+
border: 0 !important;
|
|
126
|
+
font-size: 16px !important;
|
|
127
|
+
display: block !important;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/* ANDROID CENTER FIX */
|
|
133
|
+
div[style*="margin: 16px 0;"] {
|
|
134
|
+
margin: 0 !important;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
a {
|
|
138
|
+
color: white;
|
|
139
|
+
text-decoration: underline;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.blue-link {
|
|
143
|
+
color: #1B6B82;
|
|
144
|
+
}
|
|
145
|
+
</style>
|
|
146
|
+
</head>
|
|
147
|
+
|
|
148
|
+
<body style="margin: 0 !important; padding: 0 !important; background-color:#F5F5F5;">
|
|
149
|
+
|
|
150
|
+
<!-- ONE COLUMN SECTION -->
|
|
151
|
+
<table bgcolor="#F5F5F5" border="0" cellpadding="0" cellspacing="0" width="100%">
|
|
152
|
+
|
|
153
|
+
<tr>
|
|
154
|
+
<td align="center" style="padding: 60px 16px 16px; margin-top: -32px;" class="section-padding">
|
|
155
|
+
<!--[if (gte mso 9)|(IE)]>
|
|
156
|
+
<table align="center" border="0" cellspacing="0" cellpadding="0" width="500">
|
|
157
|
+
<tr>
|
|
158
|
+
<td align="center" valign="top" width="500">
|
|
159
|
+
<![endif]-->
|
|
160
|
+
<table bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" width="100%" style="max-width: 520px;"
|
|
161
|
+
class="responsive-table">
|
|
162
|
+
<tr>
|
|
163
|
+
<td>
|
|
164
|
+
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
|
165
|
+
<tr>
|
|
166
|
+
<td>
|
|
167
|
+
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
|
168
|
+
<tr>
|
|
169
|
+
<td align="center"
|
|
170
|
+
style="padding: 32px 0 0 0; font-size: 18px; line-height: 25px; font-family: Helvetica, Arial, sans-serif; color: #3F414F;"
|
|
171
|
+
class="padding-copy">
|
|
172
|
+
Cancer Immunologic Data Center (CIDC)</td>
|
|
173
|
+
</tr>
|
|
174
|
+
<tr>
|
|
175
|
+
<td align="center"
|
|
176
|
+
style="padding: 50px 32px 0 32px; line-height: 42px; font-family: Helvetica, Arial, sans-serif; color: #666666;">
|
|
177
|
+
<h1 style="margin:0; mso-line-height-rule:exactly; padding: 0 32px 0 32px">
|
|
178
|
+
$HEADING
|
|
179
|
+
</h1>
|
|
180
|
+
</td>
|
|
181
|
+
</tr>
|
|
182
|
+
<tr>
|
|
183
|
+
<td align="center"
|
|
184
|
+
style="padding: 40px 40px 40px 40px; font-size: 16px; line-height: 25px; font-family: Helvetica, Arial, sans-serif; color: #666666;"
|
|
185
|
+
class="padding-copy">
|
|
186
|
+
$CONTENT
|
|
187
|
+
</td>
|
|
188
|
+
</tr>
|
|
189
|
+
</table>
|
|
190
|
+
</td>
|
|
191
|
+
</tr>
|
|
192
|
+
</table>
|
|
193
|
+
</td>
|
|
194
|
+
</tr>
|
|
195
|
+
</table>
|
|
196
|
+
<!--[if (gte mso 9)|(IE)]>
|
|
197
|
+
</td>
|
|
198
|
+
</tr>
|
|
199
|
+
</table>
|
|
200
|
+
<![endif]-->
|
|
201
|
+
</td>
|
|
202
|
+
</tr>
|
|
203
|
+
<tr>
|
|
204
|
+
<td align="center" style="padding: 20px 0px;">
|
|
205
|
+
<!--[if (gte mso 9)|(IE)]>
|
|
206
|
+
<table align="center" border="0" cellspacing="0" cellpadding="0" width="500">
|
|
207
|
+
<tr>
|
|
208
|
+
<td align="center" valign="top" width="500">
|
|
209
|
+
<![endif]-->
|
|
210
|
+
<table bgcolor="#1B6B82" width="100%" border="0" cellspacing="0" cellpadding="0" align="center"
|
|
211
|
+
style="max-width: 520px; " class="responsive-table">
|
|
212
|
+
<tr>
|
|
213
|
+
<td align="center"
|
|
214
|
+
style="padding: 20px 0 0 0; font-size: 18px; line-height: 18px; font-family: Helvetica, Arial, sans-serif; color:#fff; text-align: center">
|
|
215
|
+
Need help?
|
|
216
|
+
</td>
|
|
217
|
+
</tr>
|
|
218
|
+
<tr>
|
|
219
|
+
<td align="center"
|
|
220
|
+
style="padding: 10px 0 20px 0; font-size: 14px; line-height: 18px; font-family: Helvetica, Arial, sans-serif; color:#fff; text-align: center">
|
|
221
|
+
Send us an email at <a href="mailto:ncicidcadmin@mail.nih.gov">ncicidcadmin@mail.nih.gov</a>
|
|
222
|
+
</td>
|
|
223
|
+
</tr>
|
|
224
|
+
</table>
|
|
225
|
+
<!--[if (gte mso 9)|(IE)]>
|
|
226
|
+
</td>
|
|
227
|
+
</tr>
|
|
228
|
+
</table>
|
|
229
|
+
<![endif]-->
|
|
230
|
+
</td>
|
|
231
|
+
</tr>
|
|
232
|
+
<tr>
|
|
233
|
+
<td align="center" style="padding: 20px 0px;">
|
|
234
|
+
<!--[if (gte mso 9)|(IE)]>
|
|
235
|
+
<table align="center" border="0" cellspacing="0" cellpadding="0" width="500">
|
|
236
|
+
<tr>
|
|
237
|
+
<td align="center" valign="top" width="500">
|
|
238
|
+
<![endif]-->
|
|
239
|
+
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" style="max-width: 520px; "
|
|
240
|
+
class="responsive-table">
|
|
241
|
+
<tr>
|
|
242
|
+
<td align="center"
|
|
243
|
+
style="padding: 10px 0 20px 0; font-size: 14px; line-height: 18px; font-family: Helvetica, Arial, sans-serif; color:#666666;">
|
|
244
|
+
National Cancer Institute at the National institutes of Health
|
|
245
|
+
</td>
|
|
246
|
+
</tr>
|
|
247
|
+
</table>
|
|
248
|
+
<!--[if (gte mso 9)|(IE)]>
|
|
249
|
+
</td>
|
|
250
|
+
</tr>
|
|
251
|
+
</table>
|
|
252
|
+
<![endif]-->
|
|
253
|
+
</td>
|
|
254
|
+
</tr>
|
|
255
|
+
</table>
|
|
256
|
+
</body>
|
|
257
|
+
|
|
258
|
+
</html>
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"""Template functions for CIDC email bodies."""
|
|
2
2
|
|
|
3
3
|
import html
|
|
4
|
+
import pathlib
|
|
4
5
|
from functools import wraps
|
|
5
6
|
from typing import List
|
|
6
7
|
|
|
7
8
|
from . import gcloud_client
|
|
8
|
-
from ..config.settings import ENV
|
|
9
|
+
from ..config.settings import ENV, ALLOWED_CLIENT_URL, CIDC_CLINICAL_DATA_EMAIL, CIDC_ADMIN_EMAIL
|
|
9
10
|
|
|
10
11
|
# emails this list for
|
|
11
12
|
# - new user registration,
|
|
@@ -44,7 +45,7 @@ def confirm_account_approval(user) -> dict:
|
|
|
44
45
|
html_content = f"""
|
|
45
46
|
<p>Hello {user.first_n},</p>
|
|
46
47
|
<p>
|
|
47
|
-
Your CIMAC-CIDC Portal account has been approved!
|
|
48
|
+
Your CIMAC-CIDC Portal account has been approved!
|
|
48
49
|
To begin browsing and downloading data, visit https://cidc.nci.nih.gov.
|
|
49
50
|
</p>
|
|
50
51
|
<p>
|
|
@@ -150,3 +151,32 @@ def notify_mailing_list(subject: str, html_content: str) -> dict:
|
|
|
150
151
|
"html_content": html_content,
|
|
151
152
|
}
|
|
152
153
|
return email
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
with open(pathlib.Path(__file__).parent.joinpath("email_layout.html"), encoding="utf-8") as file:
|
|
157
|
+
EMAIL_LAYOUT = file.read()
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
@sendable
|
|
161
|
+
def new_validation_review(job: dict) -> dict:
|
|
162
|
+
# these two emails are set only in prod env file
|
|
163
|
+
if CIDC_CLINICAL_DATA_EMAIL and CIDC_ADMIN_EMAIL:
|
|
164
|
+
to_emails = [CIDC_CLINICAL_DATA_EMAIL, CIDC_ADMIN_EMAIL]
|
|
165
|
+
else:
|
|
166
|
+
to_emails = CIDC_MAILING_LIST
|
|
167
|
+
|
|
168
|
+
subject = f"Trial {job.trial_id} ({job.version}) Ready for Validation Review"
|
|
169
|
+
html_heading = "Clinical Data Upload Notification"
|
|
170
|
+
job_url = f"{ALLOWED_CLIENT_URL}/upload-clinical-data/{job.id}"
|
|
171
|
+
|
|
172
|
+
html_content = f"""
|
|
173
|
+
<b>Ready for Validation Review:</b><br>
|
|
174
|
+
<b><a class="blue-link" href={job_url}>Trial {job.trial_id} version {job.version} (Job ID {job.id})</a></b>
|
|
175
|
+
Please follow the link to access the trial's clinical data submission page.
|
|
176
|
+
"""
|
|
177
|
+
|
|
178
|
+
return {
|
|
179
|
+
"to_emails": to_emails,
|
|
180
|
+
"subject": subject,
|
|
181
|
+
"html_content": EMAIL_LAYOUT.replace("$HEADING", html_heading).replace("$CONTENT", html_content),
|
|
182
|
+
}
|
|
@@ -18,6 +18,7 @@ cidc_api/models/files/details.py
|
|
|
18
18
|
cidc_api/models/files/facets.py
|
|
19
19
|
cidc_api/shared/__init__.py
|
|
20
20
|
cidc_api/shared/auth.py
|
|
21
|
+
cidc_api/shared/email_layout.html
|
|
21
22
|
cidc_api/shared/emails.py
|
|
22
23
|
cidc_api/shared/file_handling.py
|
|
23
24
|
cidc_api/shared/gcloud_client.py
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
include requirements.modules.txt
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{nci_cidc_api_modules-1.2.12 → nci_cidc_api_modules-1.2.14}/cidc_api/models/files/__init__.py
RENAMED
|
File without changes
|
{nci_cidc_api_modules-1.2.12 → nci_cidc_api_modules-1.2.14}/cidc_api/models/files/details.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{nci_cidc_api_modules-1.2.12 → nci_cidc_api_modules-1.2.14}/cidc_api/shared/file_handling.py
RENAMED
|
File without changes
|
{nci_cidc_api_modules-1.2.12 → nci_cidc_api_modules-1.2.14}/cidc_api/shared/gcloud_client.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|