Browse Source

Reorder status logic

pull/2653/head
Manny Dinssa 2 years ago
parent
commit
5cbf7b2872
  1. 5
      app/models/bulk_upload.rb

5
app/models/bulk_upload.rb

@ -46,7 +46,6 @@ class BulkUpload < ApplicationRecord
def status def status
return :blank_template if failed == "blank_template" return :blank_template if failed == "blank_template"
return :wrong_template if failed == "wrong_template" return :wrong_template if failed == "wrong_template"
return :logs_uploaded_no_errors if bulk_upload_errors.none?
if logs.visible.exists? if logs.visible.exists?
return :errors_fixed_in_service if completed? && bulk_upload_errors.any? return :errors_fixed_in_service if completed? && bulk_upload_errors.any?
@ -55,10 +54,12 @@ class BulkUpload < ApplicationRecord
if bulk_upload_errors.any? { |error| error.category == "setup" } if bulk_upload_errors.any? { |error| error.category == "setup" }
:important_errors :important_errors
elsif bulk_upload_errors.any? { |error| error.category.nil? || error.category == "not_answered" }
:critical_errors
elsif bulk_upload_errors.any? { |error| error.category == "soft_validation" } elsif bulk_upload_errors.any? { |error| error.category == "soft_validation" }
:potential_errors :potential_errors
else else
:critical_errors :logs_uploaded_no_errors
end end
end end

Loading…
Cancel
Save