Skip to content

Commit

Permalink
Upgrade != to cats =!= (#801)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdulac authored Oct 27, 2020
1 parent d08b0e3 commit 7cd1acb
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion app/actions/LoginAction.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/UserController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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())
Expand Down
7 changes: 4 additions & 3 deletions app/models/Application.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/services/TokenService.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
}
Expand Down
2 changes: 1 addition & 1 deletion app/tasks/AutoAddExpertTask.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7cd1acb

Please sign in to comment.