diff --git a/travo/jupyter_course.py b/travo/jupyter_course.py index 1690417e868c0081d3b03de67b387edc164f93b6..91f2e1fc1904d71222a991a2e0d0224c740ad403 100644 --- a/travo/jupyter_course.py +++ b/travo/jupyter_course.py @@ -75,7 +75,7 @@ quality_report = """ jupyterhub_host = "https://jupyterhub.ijclab.in2p3.fr" -def jupyter_notebook_in_hub( +def jupyter_lab_in_hub( path: str, debug: bool = False, background: bool = False ) -> Optional[str]: """ @@ -106,12 +106,12 @@ def jupyter_notebook_in_hub( command = [ "jupyter", - "notebook", + "lab", "--no-browser", - f"--NotebookApp.base_url={prefix}proxy/absolute/{port}/", + f"--LabApp.base_url={prefix}proxy/absolute/{port}/", f"--port={port}", f"--log-level={log_level}", - "--NotebookApp.allow_remote_access=True", + "--LabApp.allow_remote_access=True", ] if background: subprocess.Popen(command) @@ -128,7 +128,7 @@ def jupyter_notebook(path: str) -> None: This works both in the command line or within a JupyterHub """ if "JUPYTERHUB_SERVICE_PREFIX" in os.environ: - jupyter_notebook_in_hub(path) + jupyter_lab_in_hub(path) else: subprocess.run( [ @@ -897,7 +897,7 @@ class JupyterCourse(Course): if "JUPYTERHUB_SERVICE_PREFIX" in os.environ: print("Launching formgrader in the background") - jurl = jupyter_notebook_in_hub(path=url, background=True) + jurl = jupyter_lab_in_hub(path=url, background=True) assert ( jurl is not None ) # TODO check if jurl can be None and what it means diff --git a/travo/nbgrader_utils.py b/travo/nbgrader_utils.py index cfc80ab76e9b2cb397c1c84816ebd7380ddb8836..8a07258123a53f34c8c106ea34195a195389c469 100644 --- a/travo/nbgrader_utils.py +++ b/travo/nbgrader_utils.py @@ -67,7 +67,11 @@ def merge_submission_gradebook( args, kwargs = to_args(submission, ["student"]) del kwargs["first_name"] del kwargs["last_name"] - target.update_or_create_submission(assignment.name, *args, **kwargs) + # Don't pass in kwargs, because only the student name is + # relevant to be able to create a submission, while + # updating an attribute like the id in the database may + # wreak havoc + target.update_or_create_submission(assignment.name, *args) # , **kwargs) for notebook in submission.notebooks: for grade in notebook.grades: