diff --git a/app/models/funder.rb b/app/models/funder.rb index 8a2971215..b8a2f63f3 100644 --- a/app/models/funder.rb +++ b/app/models/funder.rb @@ -44,8 +44,9 @@ def self.query(query, options={}) def self.parse_message(id: nil, message: nil) if message["location"].present? c = ISO3166::Country.find_country_by_name(message["location"]) + code = c.alpha2.present? ? c.alpha2 : nil country = { - "code" => c.alpha2, + "code" => code, "name" => message["location"] } else