Merge pull request #208 from seanmorley15/development
Add world travel regions initially
This commit is contained in:
@@ -525,6 +525,7 @@ class Command(BaseCommand):
|
|||||||
('IS-8', 'Suðurland', 'is'),
|
('IS-8', 'Suðurland', 'is'),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
if not force and (Country.objects.exists() or Region.objects.exists()):
|
if not force and (Country.objects.exists() or Region.objects.exists()):
|
||||||
self.stdout.write(self.style.WARNING(
|
self.stdout.write(self.style.WARNING(
|
||||||
'Countries or regions already exist in the database. Use --force to override.'
|
'Countries or regions already exist in the database. Use --force to override.'
|
||||||
@@ -582,8 +583,10 @@ class Command(BaseCommand):
|
|||||||
defaults={'name': name, 'continent': continent}
|
defaults={'name': name, 'continent': continent}
|
||||||
)
|
)
|
||||||
if created:
|
if created:
|
||||||
|
saveCountryFlag(country_code)
|
||||||
self.stdout.write(f'Inserted {name} into worldtravel countries')
|
self.stdout.write(f'Inserted {name} into worldtravel countries')
|
||||||
else:
|
else:
|
||||||
|
saveCountryFlag(country_code)
|
||||||
self.stdout.write(f'{name} already exists in worldtravel countries')
|
self.stdout.write(f'{name} already exists in worldtravel countries')
|
||||||
|
|
||||||
def insert_regions(self, regions):
|
def insert_regions(self, regions):
|
||||||
|
|||||||
Reference in New Issue
Block a user