Skip to content

Commit

Permalink
Only get session_id from POST response if request is successful
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminastrand committed Dec 3, 2024
1 parent 9e95816 commit c6336d0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions fedn/network/api/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -645,10 +645,9 @@ def start_session(
headers=self.headers,
)

if id is None:
id = response.json()["session_id"]

if response.status_code == 201:
if id is None:
id = response.json()["session_id"]
response = requests.post(
self._get_url_api_v1("sessions/start"),
json={
Expand Down

0 comments on commit c6336d0

Please sign in to comment.