=== modified file 'loco_directory/teams/management/commands/update-countries.py' --- loco_directory/teams/management/commands/update-countries.py 2010-06-22 07:33:00 +0000 +++ loco_directory/teams/management/commands/update-countries.py 2010-08-06 11:16:56 +0000 @@ -36,7 +36,9 @@ doc = xml.dom.minidom.parse(country_list) country_entries = doc.getElementsByTagName('iso_3166_entry') for country_entry in country_entries: - if country_entry.getAttribute('name'): + if country_entry.getAttribute('common_name'): + country, created = models.Country.objects.get_or_create(name=country_entry.getAttribute('common_name')) + elif country_entry.getAttribute('name'): country, created = models.Country.objects.get_or_create(name=country_entry.getAttribute('name')) - if created: - country.save() + if created: + country.save()