diff --git a/app/actions/LoginAction.scala b/app/actions/LoginAction.scala index 6b4e87c33..29db50082 100644 --- a/app/actions/LoginAction.scala +++ b/app/actions/LoginAction.scala @@ -176,7 +176,7 @@ class LoginAction @Inject() ( implicit val requestWithUserData = new RequestWithUserData(user, userRights, request) - if (token.ipAddress != request.remoteAddress) { + if (token.ipAddress =!= request.remoteAddress) { eventService.log( AuthWithDifferentIp, s"Utilisateur ${token.userId} à une adresse ip différente pour l'essai de connexion" diff --git a/app/controllers/UserController.scala b/app/controllers/UserController.scala index 02c68c98e..e4888c884 100644 --- a/app/controllers/UserController.scala +++ b/app/controllers/UserController.scala @@ -511,7 +511,7 @@ case class UserController @Inject() ( lastName, qualite, phoneNumber - ) if redirect != routes.ApplicationController.myApplications().url => + ) if redirect =!= routes.ApplicationController.myApplications().url => validateAndUpdateUser(request.currentUser)(firstName, lastName, qualite, phoneNumber) eventService.log(CGUValidated, "CGU validées") Redirect(Call("GET", redirect)).flashing("success" -> "Merci d’avoir accepté les CGU") @@ -521,7 +521,7 @@ case class UserController @Inject() ( Redirect(routes.HomeController.welcome()) .flashing("success" -> "Merci d’avoir accepté les CGU") case ValidateSubscriptionForm(Some(redirect), false, _, _, _, _) - if redirect != routes.ApplicationController.myApplications().url => + if redirect =!= routes.ApplicationController.myApplications().url => Redirect(Call("GET", redirect)) case ValidateSubscriptionForm(_, false, _, _, _, _) => Redirect(routes.HomeController.welcome()) diff --git a/app/models/Application.scala b/app/models/Application.scala index 69a32646b..07013dd9e 100644 --- a/app/models/Application.scala +++ b/app/models/Application.scala @@ -69,8 +69,9 @@ case class Application( def longStatus(user: User) = closed match { - case true => "Clôturée" - case _ if user.id === creatorUserId && answers.exists(_.creatorUserID != user.id) => "Répondu" + case true => "Clôturée" + case _ if user.id === creatorUserId && answers.exists(_.creatorUserID =!= user.id) => + "Répondu" case _ if user.id === creatorUserId && seenByUserIds .intersect(invitedUsers.keys.toList) @@ -175,7 +176,7 @@ case class Application( None } - lazy val firstAgentAnswerDate = answers.find(_.id != creatorUserId).map(_.creationDate) + lazy val firstAgentAnswerDate = answers.find(_.id =!= creatorUserId).map(_.creationDate) lazy val firstAnswerTimeInMinutes: Option[Int] = firstAgentAnswerDate.map { firstAnswerDate => MINUTES.between(creationDate, firstAnswerDate).toInt diff --git a/app/services/TokenService.scala b/app/services/TokenService.scala index 31429768b..c01b2244b 100644 --- a/app/services/TokenService.scala +++ b/app/services/TokenService.scala @@ -38,7 +38,7 @@ class TokenService @Inject() (configuration: play.api.Configuration, db: Databas // To be sure the token is used only once, we remove it from the database if ( result.nonEmpty && SQL"""DELETE FROM login_token WHERE token = $token""" - .executeUpdate() != 1 + .executeUpdate() =!= 1 ) { throw UnexpectedException(Some(s"loginToken $token can't be removed on byToken")) } diff --git a/app/tasks/AutoAddExpertTask.scala b/app/tasks/AutoAddExpertTask.scala index d5db80609..e752ebd4b 100644 --- a/app/tasks/AutoAddExpertTask.scala +++ b/app/tasks/AutoAddExpertTask.scala @@ -38,7 +38,7 @@ class AutoAddExpertTask @Inject() ( def inviteExpertsInApplication() = if (configuration.get[Boolean]("app.features.autoAddExpert")) { applicationService.openAndOlderThan(dayWithoutAgentAnswer).foreach { application => - application.answers.filter(_.creatorUserID != application.creatorUserId).lastOption match { + application.answers.filter(_.creatorUserID =!= application.creatorUserId).lastOption match { case None => // No answer for someone else the creator inviteExpert(application, dayWithoutAgentAnswer) case Some(answer)