Skip to content

Commit 29a181b

Browse files
committed
Fix saving new jupyter notebooks
1 parent 6b29c18 commit 29a181b

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

src/apphandler.js

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -998,17 +998,15 @@ export class AppHandler {
998998
}
999999
const lecturescol = this.mongo.collection('lectures')
10001000
// date
1001-
if (!details?.ipynbs) {
1002-
await lecturescol.updateOne(
1003-
{ uuid: lectureuuid },
1004-
{
1005-
$addToSet: {
1006-
ipynbs: { id: pynb.id }
1007-
},
1008-
$currentDate: { lastaccess: true }
1009-
}
1010-
)
1011-
}
1001+
await lecturescol.updateOne(
1002+
{ uuid: lectureuuid, 'ipynbs.id': { $ne: pynb.id } },
1003+
{
1004+
$addToSet: {
1005+
ipynbs: { id: pynb.id }
1006+
},
1007+
$currentDate: { lastaccess: true }
1008+
}
1009+
)
10121010
await lecturescol.updateOne(
10131011
{ uuid: lectureuuid },
10141012
{

0 commit comments

Comments
 (0)