coderholic/django-cities

District import is failing when using MySQL

Opened this issue · 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.

except City.DoesNotExist as e:

I have solved this by modifying L635 as follows:

 except (City.DoesNotExist, ValueError) as e: