From a48b2bf752e30c006d6a6e5fbe1736dd54cf5ca3 Mon Sep 17 00:00:00 2001 From: Sean Morley Date: Fri, 16 Aug 2024 10:40:23 -0400 Subject: [PATCH] Add world travel regions initially --- .../server/worldtravel/management/commands/worldtravel-seed.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/server/worldtravel/management/commands/worldtravel-seed.py b/backend/server/worldtravel/management/commands/worldtravel-seed.py index 6712fe1..4a2eab0 100644 --- a/backend/server/worldtravel/management/commands/worldtravel-seed.py +++ b/backend/server/worldtravel/management/commands/worldtravel-seed.py @@ -524,6 +524,7 @@ class Command(BaseCommand): ('IS-7', 'Austurland', 'is'), ('IS-8', 'Suðurland', 'is'), ] + if not force and (Country.objects.exists() or Region.objects.exists()): self.stdout.write(self.style.WARNING( @@ -582,8 +583,10 @@ class Command(BaseCommand): defaults={'name': name, 'continent': continent} ) if created: + saveCountryFlag(country_code) self.stdout.write(f'Inserted {name} into worldtravel countries') else: + saveCountryFlag(country_code) self.stdout.write(f'{name} already exists in worldtravel countries') def insert_regions(self, regions):