Skip to content

Commit 3466ff3

Browse files
authored
Merge pull request #177 from ecmwf-projects/fix-portals
Handle empty or None portal_header
2 parents fe63381 + 03699fe commit 3466ff3

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

cads_processing_api_service/auth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def authenticate_user(
111111
request_url,
112112
headers={
113113
auth_header[0]: auth_header[1],
114-
config.PORTAL_HEADER_NAME: portal_header, # type: ignore
114+
config.PORTAL_HEADER_NAME: portal_header,
115115
},
116116
)
117117
if response.status_code in (

cads_processing_api_service/clients.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,9 @@ def get_jobs(
288288
List of jobs status information.
289289
"""
290290
user_uid, _ = auth.authenticate_user(auth_header, portal_header)
291-
portals = [p.strip() for p in portal_header.split(",")]
291+
portals = (
292+
[p.strip() for p in portal_header.split(",")] if portal_header else None
293+
)
292294
job_filters = {
293295
"process_id": processID,
294296
"status": status,
@@ -405,7 +407,9 @@ def get_job(
405407
Job status information.
406408
"""
407409
user_uid, _ = auth.authenticate_user(auth_header, portal_header)
408-
portals = [p.strip() for p in portal_header.split(",")]
410+
portals = (
411+
[p.strip() for p in portal_header.split(",")] if portal_header else None
412+
)
409413
try:
410414
compute_sessionmaker = db_utils.get_compute_sessionmaker(
411415
mode=db_utils.ConnectionMode.read

0 commit comments

Comments
 (0)