remove email related code
Build and Push Docker Images / Build and Push Docker Images (push) Failing after 9s
Build and Push Docker Images / Build and Push Docker Images (push) Failing after 9s
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
# api/management/commands/seed.py
|
||||
|
||||
from django.core.management.base import BaseCommand
|
||||
from api.models import Atoll, Island
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
help = "Seeds baseline reference data (atolls and islands) required for sign up."
|
||||
|
||||
def handle(self, *args, **options):
|
||||
atoll, atoll_created = Atoll.objects.get_or_create(name="Faafu")
|
||||
self.stdout.write(
|
||||
self.style.SUCCESS(f"Created atoll: {atoll.name}")
|
||||
if atoll_created
|
||||
else self.style.NOTICE(f"Atoll already exists: {atoll.name}")
|
||||
)
|
||||
|
||||
island, island_created = Island.objects.get_or_create(
|
||||
name="Dharanboodhoo", defaults={"atoll": atoll}
|
||||
)
|
||||
self.stdout.write(
|
||||
self.style.SUCCESS(f"Created island: {island.name} ({atoll.name})")
|
||||
if island_created
|
||||
else self.style.NOTICE(f"Island already exists: {island.name}")
|
||||
)
|
||||
|
||||
self.stdout.write(self.style.SUCCESS("Seeding complete."))
|
||||
Reference in New Issue
Block a user