Skip to content

Commit c80ed1f

Browse files
committed
Bugfix: Jupyterhub master (beyond 0.9.4) makes get_current_user coroutine
1 parent f415e28 commit c80ed1f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

batchspawner/api.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@ class BatchSpawnerAPIHandler(APIHandler):
66
@web.authenticated
77
def post(self):
88
"""POST set user spawner data"""
9-
user = self.get_current_user()
9+
if hasattr(self, 'current_user'):
10+
# Jupyterhub compatability, (september 2018, d79a99323ef1d)
11+
user = self.current_user
12+
else:
13+
# Previous jupyterhub, 0.9.4 and before.
14+
user = self.get_current_user()
1015
data = self.get_json_body()
1116
for key, value in data.items():
1217
if hasattr(user.spawner, key):

0 commit comments

Comments
 (0)