User.studyTv: if not found, redirect to routes.Study.byOwnerDefault
This commit is contained in:
parent
f6bf1bc7f6
commit
872457a3d5
|
@ -34,7 +34,7 @@ object User extends LilaController {
|
|||
def studyTv(username: String) = Open { implicit ctx =>
|
||||
OptionFuResult (UserRepo named username) { user =>
|
||||
lila.relation.Env.current.onlineStudying.get(user.id) match {
|
||||
case None => notFound
|
||||
case None => fuccess(Redirect(routes.Study.byOwnerDefault(user.id)))
|
||||
case Some(studyId) => fuccess(Redirect(routes.Study.show(studyId)))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue