From 184e9304900184536af3b8e0c67881771910fa32 Mon Sep 17 00:00:00 2001 From: Kasper Brandt Date: Wed, 18 May 2016 12:30:52 +0200 Subject: [PATCH] [#2167] Fix unknown countries in recipient country model --- akvo/rsr/models/country.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/akvo/rsr/models/country.py b/akvo/rsr/models/country.py index 5c1518610c..86c5193a97 100644 --- a/akvo/rsr/models/country.py +++ b/akvo/rsr/models/country.py @@ -69,7 +69,10 @@ class RecipientCountry(models.Model): def __unicode__(self): if self.country: - country_unicode = self.iati_country().name + try: + country_unicode = self.iati_country().name + except codelist_models.Country.DoesNotExist: + country_unicode = self.country else: country_unicode = u'%s' % _(u'No country specified')