File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -469,8 +469,11 @@ async def nebula_update_user(
469
469
470
470
471
471
@app .get ("/platform/api/dashboard/runningscenario" , response_class = JSONResponse )
472
- async def nebula_dashboard_runningscenario ():
473
- scenario_running = get_running_scenario ()
472
+ async def nebula_dashboard_runningscenario (session : dict = Depends (get_session )):
473
+ if session .get ("role" ) == "admin" :
474
+ scenario_running = get_running_scenario ()
475
+ elif "user" in session :
476
+ scenario_running = get_running_scenario (session ["user" ])
474
477
if scenario_running :
475
478
scenario_running_as_dict = dict (scenario_running )
476
479
scenario_running_as_dict ["scenario_status" ] = "running"
@@ -586,7 +589,11 @@ async def nebula_dashboard(request: Request, session: dict = Depends(get_session
586
589
scenarios = get_all_scenarios_and_check_completed (
587
590
username = session ["user" ], role = session ["role" ]
588
591
) # Get all scenarios after checking if they are completed
589
- scenario_running = get_running_scenario ()
592
+ if session .get ("role" ) == "admin" :
593
+ scenario_running = get_running_scenario ()
594
+ else :
595
+ scenario_running = get_running_scenario (username = session ["user" ])
596
+
590
597
if session ["user" ] not in user_data_store :
591
598
user_data_store [session ["user" ]] = UserData ()
592
599
You can’t perform that action at this time.
0 commit comments