Skip to content

Commit

Permalink
add formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
CollinBeczak committed Aug 29, 2023
1 parent eb30cee commit 2044681
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions app/org/maproulette/framework/service/TaskBundleService.scala
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,22 @@ class TaskBundleService @Inject() (
throw new InvalidException("Must be at least one task to bundle.")
}

val challengeId = tasks.head.parent
val challengeId = tasks.head.parent
val cooperativeWork = tasks.head.cooperativeWork.isDefined

// Verify tasks
// 1. Must belong to same challenge
// 2. Cooperative tasks not allowed
for (task <- tasks) {
if (cooperativeWork == true && task.cooperativeWork.isDefined != cooperativeWork) {
throw new InvalidException("The main task type is Cooperative. All selected tasks must be Cooperative.")
throw new InvalidException(
"The main task type is Cooperative. All selected tasks must be Cooperative."
)
}
if (cooperativeWork == false && task.cooperativeWork.isDefined != cooperativeWork) {
throw new InvalidException("The main task type is not Cooperative. All selected tasks must not be Cooperative.")
if (cooperativeWork == false && task.cooperativeWork.isDefined != cooperativeWork) {
throw new InvalidException(
"The main task type is not Cooperative. All selected tasks must not be Cooperative."
)
}
if (task.parent != challengeId) {
throw new InvalidException(
Expand Down

0 comments on commit 2044681

Please sign in to comment.