django-cities icon indicating copy to clipboard operation
django-cities copied to clipboard

District import is failing when using MySQL

Open calinrada opened this issue 6 years ago • 0 comments

Environment:

Python 3.6.4 Django 2.0.7 django-cities 0.5.0.6 Ubuntu 16.04 MySQL 5.7

Command:

$ manage.py cities import

or

$ manage.py cities --import=district

Importing districts will fail with a ValueError exception that it's not handled.

https://github.com/coderholic/django-cities/blob/1a60b31c4d7eb43e4cd6ee0e5fa4d7908c0db07c/cities/management/commands/cities.py#L635

I have solved this by modifying L635 as follows:

 except (City.DoesNotExist, ValueError) as e:

calinrada avatar Sep 19 '18 14:09 calinrada