Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle empty or None portal_header #177

Merged
merged 3 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cads_processing_api_service/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def authenticate_user(
request_url,
headers={
auth_header[0]: auth_header[1],
config.PORTAL_HEADER_NAME: portal_header, # type: ignore
config.PORTAL_HEADER_NAME: portal_header,
},
)
if response.status_code in (
Expand Down
8 changes: 6 additions & 2 deletions cads_processing_api_service/clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,9 @@ def get_jobs(
List of jobs status information.
"""
user_uid, _ = auth.authenticate_user(auth_header, portal_header)
portals = [p.strip() for p in portal_header.split(",")]
portals = (
[p.strip() for p in portal_header.split(",")] if portal_header else None
)
job_filters = {
"process_id": processID,
"status": status,
Expand Down Expand Up @@ -405,7 +407,9 @@ def get_job(
Job status information.
"""
user_uid, _ = auth.authenticate_user(auth_header, portal_header)
portals = [p.strip() for p in portal_header.split(",")]
portals = (
[p.strip() for p in portal_header.split(",")] if portal_header else None
)
try:
compute_sessionmaker = db_utils.get_compute_sessionmaker(
mode=db_utils.ConnectionMode.read
Expand Down
Loading