Skip to content

Commit

Permalink
Feature/SK-1249 | Session start should return 400 if session is runni…
Browse files Browse the repository at this point in the history
…ng (#771)
  • Loading branch information
niklastheman authored Dec 10, 2024
1 parent c416b72 commit 95cb5a5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fedn/network/api/v1/session_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ def start_session():
min_clients = session_config["clients_required"]

if control.state() == ReducerState.monitoring:
return jsonify({"message": "A session is already running."})
return jsonify({"message": "A session is already running!"}), 400

if not rounds or not isinstance(rounds, int):
rounds = session_config["rounds"]
Expand All @@ -410,6 +410,7 @@ def start_session():
except Exception:
return jsonify({"message": "An unexpected error occurred"}), 500


@bp.route("/<string:id>", methods=["PATCH"])
@jwt_auth_required(role="admin")
def patch_session(id: str):
Expand Down

0 comments on commit 95cb5a5

Please sign in to comment.