simplify User.studyTv
This commit is contained in:
parent
2aa21da9ee
commit
694a43218c
|
@ -32,10 +32,12 @@ object User extends LilaController {
|
|||
}
|
||||
|
||||
def studyTv(username: String) = Open { implicit ctx =>
|
||||
OptionFuResult (UserRepo named username) { user =>
|
||||
OptionResult(UserRepo named username) { user =>
|
||||
Redirect {
|
||||
lila.relation.Env.current.onlineStudying.get(user.id) match {
|
||||
case None => fuccess(Redirect(routes.Study.byOwnerDefault(user.id)))
|
||||
case Some(studyId) => fuccess(Redirect(routes.Study.show(studyId)))
|
||||
case None => routes.Study.byOwnerDefault(user.id)
|
||||
case Some(studyId) => routes.Study.show(studyId)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue