Skip to content

Commit

Permalink
Allow sending an assessment to review
Browse files Browse the repository at this point in the history
This makes it possible to send an assessment to review if the LoPS is
unable to be verified by an admin user.
  • Loading branch information
thomasleese committed Oct 9, 2023
1 parent ae538f3 commit b3966c9
Showing 1 changed file with 31 additions and 12 deletions.
43 changes: 31 additions & 12 deletions app/models/assessment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def can_award?
elsif verify?
enough_reference_requests_review_passed? &&
all_qualification_requests_review_passed? &&
professional_standing_request_review_passed?
professional_standing_request_verify_passed?
elsif review?
professional_standing_request_review_passed?
else
Expand Down Expand Up @@ -134,10 +134,10 @@ def can_request_further_information?

def can_review?
return false unless application_form.created_under_new_regulations?

return false unless verify?
return false if skip_verification?

false
professional_standing_request_verify_failed?
end

def can_verify?
Expand Down Expand Up @@ -238,22 +238,41 @@ def all_qualification_requests_review_passed?
end
end

def professional_standing_request_review_passed?
if professional_standing_request_part_of_verification?
professional_standing_request.review_passed?
else
true
end
end

def professional_standing_request_review_failed?
if application_form.teaching_authority_provides_written_statement
return true
if professional_standing_request_part_of_verification?
professional_standing_request.review_failed?
else
false
end
return true if professional_standing_request.nil?
end

professional_standing_request.review_failed?
def professional_standing_request_verify_passed?
if professional_standing_request_part_of_verification?
professional_standing_request.verify_passed?
else
true
end
end

def professional_standing_request_review_passed?
if application_form.teaching_authority_provides_written_statement
return true
def professional_standing_request_verify_failed?
if professional_standing_request_part_of_verification?
professional_standing_request.verify_failed?
else
false
end
return true if professional_standing_request.nil?
end

professional_standing_request.review_passed?
def professional_standing_request_part_of_verification?
!application_form.teaching_authority_provides_written_statement &&
professional_standing_request.present?
end

def skip_verification?
Expand Down

0 comments on commit b3966c9

Please sign in to comment.