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):
12
12
else :
13
13
# Previous jupyterhub, 0.9.4 and before.
14
14
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
15
21
data = self .get_json_body ()
16
22
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 )
19
25
self .finish (json .dumps ({"message" : "BatchSpawner data configured" }))
20
26
self .set_status (201 )
21
27
Original file line number Diff line number Diff line change @@ -22,4 +22,4 @@ def main(argv=None):
22
22
run_path (cmd_path , run_name = "__main__" )
23
23
24
24
if __name__ == "__main__" :
25
- main ()
25
+ main ()
You can’t perform that action at this time.
0 commit comments