From 993ce864070c675b5a7ffda7c541362a037a605f Mon Sep 17 00:00:00 2001 From: Thibault Duplessis Date: Fri, 24 Apr 2020 12:01:35 -0600 Subject: [PATCH] fix class student user preload --- app/controllers/Clas.scala | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/controllers/Clas.scala b/app/controllers/Clas.scala index e8e6e04b57..6943a3bc97 100644 --- a/app/controllers/Clas.scala +++ b/app/controllers/Clas.scala @@ -53,22 +53,22 @@ final class Clas( ) } - private def preloadStudentUsers(students: List[lila.clas.Student.WithUser]): Funit = + private def preloadStudentUsers(students: List[lila.clas.Student.WithUser]): Unit = env.user.lightUserApi.preloadUsers(students.map(_.user)) def show(id: String) = Auth { implicit ctx => me => WithClassAny(id, me)( forTeacher = WithClass(me, id) { clas => env.clas.api.student.activeWithUsers(clas) map { students => - preloadStudentUsers(students) inject - views.html.clas.teacherDashboard.overview(clas, students) + preloadStudentUsers(students) + views.html.clas.teacherDashboard.overview(clas, students) } }, forStudent = (clas, students) => env.clas.api.clas.teachers(clas) map { teachers => + preloadStudentUsers(students) val wall = scalatags.Text.all.raw(env.clas.markup(clas.wall)) - preloadStudentUsers(students) inject - Ok(views.html.clas.studentDashboard(clas, wall, teachers, students)) + Ok(views.html.clas.studentDashboard(clas, wall, teachers, students)) } ) }