Open mohsen-mahmoodi opened 1 week ago
master
Configure CITIES_FILES for a pre-downloaded file without URL:
CITIES_FILES = { 'country': { 'filename': 'not-existing', 'urls': [] }, }
Run the import command:
python manage.py cities --import=country
Exception: File not found and download failed: citiesxx500.zip [[]]
UnboundLocalError: cannot access local variable 'url' where it is not associated with a value
In the file cities/management/commands/citities.py method def download(self, filekey):, we have a line to raise an exception like this:
cities/management/commands/citities.py
def download(self, filekey):
raise Exception("File not found and download failed: {} [{}]".format(filename, url))
It should be changed to:
raise Exception("File not found and download failed: {} [{}]".format(filename, urls))
Checklist
master
branch of django-cities.Steps to reproduce
Configure CITIES_FILES for a pre-downloaded file without URL:
Run the import command:
Expected behavior
Actual behavior
Reason
In the file
cities/management/commands/citities.py
methoddef download(self, filekey):
, we have a line to raise an exception like this:It should be changed to: