Skip to content

Commit

Permalink
Fix API Deploys
Browse files Browse the repository at this point in the history
  • Loading branch information
Ewoutvans committed Jul 15, 2018
1 parent 306bedb commit 7516581
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/ApiController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ final class ApiController @Inject()(api: OreRestfulApi,
val apiKeyExists: Future[Boolean] = this.service.DB.db.run(compiled(Deployment, formData.apiKey, projectData.project.id.get).result)

EitherT.liftF(apiKeyExists)
.filterOrElse(apiKey => !apiKey, Unauthorized(error("apiKey", "api.deploy.invalidKey")))
.filterOrElse(apiKey => apiKey, Unauthorized(error("apiKey", "api.deploy.invalidKey")))
.semiFlatMap(_ => projectData.project.versions.exists(_.versionString === name))
.filterOrElse(nameExists => !nameExists, BadRequest(error("versionName", "api.deploy.versionExists")))
.semiFlatMap(_ => projectData.project.owner.user)
Expand Down

0 comments on commit 7516581

Please sign in to comment.