Skip to content

Commit

Permalink
Fix parse_links with empty answer and include partially accepted state
Browse files Browse the repository at this point in the history
  • Loading branch information
fblupi committed Jan 16, 2025
1 parent fb6f984 commit b4612fc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions script_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def process_csv(args)
rescue UnprocessableError => e
show_error(e.message)
rescue ActiveRecord::RecordInvalid => e
show_error(e.message)
show_error(e.message)
rescue AlreadyProcessedError => e
show_warning(e.message)
end
Expand Down Expand Up @@ -109,12 +109,12 @@ def raise_if_field_not_found(field, values)

def normalize_state(state)
case state
when /^evaluating|En avaluació|En evaluación|Acceptada parcialment|Aceptada parcialmente$/i
'en_avaluacio'
when /^accepted|Acceptada|Aceptada$/i
'accepted'
'acceptada'
when /^rejected|Rebutjada|Rechazada$/i
'rejected'
when /^evaluating|En avaluació|En evaluación$/i
'evaluating'
'rebutjada'
when /^withdrawn|retirat|retirada$/i
'withdrawn'
else
Expand All @@ -124,7 +124,7 @@ def normalize_state(state)

def parse_links(texts)
texts.map do |lang, text|
[lang, Decidim::ContentRenderers::LinkRenderer.new(text.strip).render.gsub("\n", "<br>")]
[lang, text.nil? ? nil : Decidim::ContentRenderers::LinkRenderer.new((text).strip).render.gsub("\n", "<br>")]
end.to_h
end

Expand Down

0 comments on commit b4612fc

Please sign in to comment.