From 5ec8111504445400673a7fe49e9b0891017a3f70 Mon Sep 17 00:00:00 2001 From: sowinski Date: Tue, 30 Oct 2018 17:18:23 +0100 Subject: [PATCH] Update cities.py @calinrada fix https://github.com/coderholic/django-cities/issues/204 --- cities/management/commands/cities.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cities/management/commands/cities.py b/cities/management/commands/cities.py index 26ceeb4a..80eacfc6 100644 --- a/cities/management/commands/cities.py +++ b/cities/management/commands/cities.py @@ -632,7 +632,7 @@ def import_district(self): ).annotate( distance=Distance('location', defaults['location']) ).order_by('distance').first() - except City.DoesNotExist as e: + except (City.DoesNotExist, ValueError) as e: self.logger.warning( "District: %s: DB backend does not support native '.distance(...)' query " "falling back to two degree search",