Skip to content

Commit

Permalink
Update request base calculated status
Browse files Browse the repository at this point in the history
Once a requester has asked for a internal review their request's base
status shouldn't ever be `waiting_classification` as this limits the
possible classification statuses.

Returning `internal_review` allows the requester to classify the request
as `I'm still waiting for the internal review` after they receive an
acknowledgement of their review.

Fixes #3830
  • Loading branch information
gbp committed Oct 21, 2022
1 parent f9c578a commit d082470
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion app/models/info_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1020,8 +1020,18 @@ def calculate_status(cached_value_ok=false)
@cached_calculated_status = @@custom_states_loaded ? theme_calculate_status : base_calculate_status
end

def internally_reviewed?
outgoing_messages.where(what_doing: 'internal_review').any?
end

def base_calculate_status
return 'waiting_classification' if awaiting_description
if awaiting_description
if internally_reviewed?
return 'internal_review'
else
return 'waiting_classification'
end
end
return described_state unless described_state == "waiting_response"
# Compare by date, so only overdue on next day, not if 1 second late
return 'waiting_response_very_overdue' if
Expand Down

0 comments on commit d082470

Please sign in to comment.