Skip to content

Commit 97285bc

Browse files
committed
Jupyter related bug fixes
1 parent 29a181b commit 97285bc

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

src/apphandler.js

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ export class AppHandler {
255255
if (
256256
!data.ipynbs.id ||
257257
typeof data.ipynbs.id !== 'string' ||
258-
data.ipynbs.id.length > 20
258+
data.ipynbs.id.length > 9
259259
)
260260
return res.status(400).send('malformed request')
261261

@@ -976,15 +976,21 @@ export class AppHandler {
976976
if (oldNotebook?.sha) {
977977
oldsha = oldNotebook?.sha
978978
}
979-
applets?.forEach?.((applet) => {
980-
if (typeof applet.presentToStudents !== 'undefined') return
981-
const oldApplet = oldNotebook?.applets?.find?.(
982-
(appl) => appl.appid === applet.appid
983-
)
984-
if (typeof oldApplet?.presentToStudents !== 'undefined')
985-
applet.presentToStudents = oldApplet.presentToStudents
986-
else applet.presentToStudents = false
987-
})
979+
applets
980+
?.forEach?.((applet) => {
981+
if (typeof applet.presentToStudents !== 'undefined') return
982+
const oldApplet = oldNotebook?.applets?.find?.(
983+
(appl) => appl.appid === applet.appid
984+
)
985+
if (typeof oldApplet?.presentToStudents !== 'undefined')
986+
applet.presentToStudents = oldApplet.presentToStudents
987+
else applet.presentToStudents = false
988+
})
989+
?.map?.((el) => ({
990+
appid: el.appid,
991+
appname: el.appname,
992+
presentToStudents: el.presentToStudents
993+
}))
988994
const pynb = {
989995
id: body.id,
990996
name: body.name,

0 commit comments

Comments
 (0)