Skip to content

Commit

Permalink
Fix JupyterHub 4 warning
Browse files Browse the repository at this point in the history
  • Loading branch information
jtpio committed Nov 27, 2023
1 parent ac3a7a4 commit 42401ad
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
6 changes: 3 additions & 3 deletions tljh_repo2docker/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from aiodocker import Docker, DockerError
from jupyterhub.apihandlers import APIHandler
from jupyterhub.utils import admin_only
from jupyterhub.scopes import needs_scope
from tornado import web

from .docker import build_image
Expand All @@ -17,7 +17,7 @@ class BuildHandler(APIHandler):
"""

@web.authenticated
@admin_only
@needs_scope('admin-ui')
async def delete(self):
data = self.get_json_body()
name = data["name"]
Expand All @@ -31,7 +31,7 @@ async def delete(self):
self.finish(json.dumps({"status": "ok"}))

@web.authenticated
@admin_only
@needs_scope('admin-ui')
async def post(self):
data = self.get_json_body()
repo = data["repo"]
Expand Down
4 changes: 2 additions & 2 deletions tljh_repo2docker/images.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from inspect import isawaitable
from jupyterhub.handlers.base import BaseHandler
from jupyterhub.utils import admin_only
from jupyterhub.scopes import needs_scope
from tornado import web

from .docker import list_containers, list_images
Expand All @@ -12,7 +12,7 @@ class ImagesHandler(BaseHandler):
"""

@web.authenticated
@admin_only
@needs_scope('admin-ui')
async def get(self):
images = await list_images()
containers = await list_containers()
Expand Down
5 changes: 2 additions & 3 deletions tljh_repo2docker/logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

from aiodocker import Docker
from jupyterhub.apihandlers import APIHandler
from jupyterhub.utils import admin_only
from jupyterhub.scopes import needs_scope
from tornado import web
from tornado.ioloop import IOLoop
from tornado.iostream import StreamClosedError


Expand All @@ -13,7 +12,7 @@ class LogsHandler(APIHandler):
Expose a handler to follow the build logs.
"""
@web.authenticated
@admin_only
@needs_scope('admin-ui')
async def get(self, name):
self.set_header("Content-Type", "text/event-stream")
self.set_header("Cache-Control", "no-cache")
Expand Down

0 comments on commit 42401ad

Please sign in to comment.