Skip to content

Commit

Permalink
Merge pull request #16625 from yafred/teacher-not-updated-on-move
Browse files Browse the repository at this point in the history
update teacher info after transferring student to another class
  • Loading branch information
ornicar authored Dec 19, 2024
2 parents df31833 + 2115237 commit 7a032e1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion modules/clas/src/main/ClasApi.scala
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,11 @@ final class ClasApi(

def move(s: Student.WithUser, toClas: Clas)(using teacher: Me): Fu[Option[Student]] = for
_ <- closeAccount(s)
stu = s.student.copy(id = Student.makeId(s.user.id, toClas.id), clasId = toClas.id)
stu = s.student.copy(
id = Student.makeId(s.user.id, toClas.id),
clasId = toClas.id,
created = Clas.Recorded(by = teacher.userId, at = nowInstant)
)
moved <- colls.student.insert
.one(stu)
.inject(stu.some)
Expand Down

0 comments on commit 7a032e1

Please sign in to comment.