File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -12,10 +12,16 @@ def post(self):
1212 else :
1313 # Previous jupyterhub, 0.9.4 and before.
1414 user = self .get_current_user ()
15+ token = self .get_auth_token ()
16+ spawner = None
17+ for s in user .spawners .values ():
18+ if s .api_token == token :
19+ spawner = s
20+ break
1521 data = self .get_json_body ()
1622 for key , value in data .items ():
17- if hasattr (user . spawner , key ):
18- setattr (user . spawner , key , value )
23+ if hasattr (spawner , key ):
24+ setattr (spawner , key , value )
1925 self .finish (json .dumps ({"message" : "BatchSpawner data configured" }))
2026 self .set_status (201 )
2127
Original file line number Diff line number Diff line change @@ -22,4 +22,4 @@ def main(argv=None):
2222 run_path (cmd_path , run_name = "__main__" )
2323
2424if __name__ == "__main__" :
25- main ()
25+ main ()
You can’t perform that action at this time.
0 commit comments