Skip to content

Commit

Permalink
use reviewStartedAt when there's no reviewClaimedAt (#1001)
Browse files Browse the repository at this point in the history
* use reviewStartedAt when there's no reviewClaimedAt

* fix formatting
  • Loading branch information
jschwarz2030 authored Jan 11, 2023
1 parent d31b088 commit dd7fcf9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/org/maproulette/framework/service/TaskReviewService.scala
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,9 @@ class TaskReviewService @Inject() (
var additionalReviewers = task.review.additionalReviewers

// Make sure we have an updated claimed at time.
val reviewClaimedAt = this.getTaskWithReview(task.id).task.review.reviewClaimedAt
val currentTask = this.getTaskWithReview(task.id).task
val reviewClaimedAt = currentTask.review.reviewClaimedAt
val reviewStartedAt = currentTask.review.reviewStartedAt

// If the original reviewer is not the same as the user asking for this
// review status change than we have a "meta-review" situation. Let's leave
Expand Down Expand Up @@ -555,7 +557,10 @@ class TaskReviewService @Inject() (
if (originalReviewer.getOrElse(0) != user.id) Some(originalReviewer.get)
else None,
reviewStatus,
reviewClaimedAt.getOrElse(null),
reviewClaimedAt.getOrElse(
if (reviewStatus != Task.REVIEW_STATUS_REQUESTED) reviewStartedAt.getOrElse(null)
else null
),
errorTags
)

Expand Down

0 comments on commit dd7fcf9

Please sign in to comment.