Skip to content

Commit

Permalink
Whitespace and comment edits.
Browse files Browse the repository at this point in the history
  • Loading branch information
BuildTools committed Oct 13, 2023
1 parent 56fe53a commit 77b6919
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions api/management/commands/quicksetup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,28 @@ class Command(BaseCommand):

def add_arguments(self, parser: argparse.ArgumentParser):
"""Define arguments for the `manage.py quicksetup` subcommand."""

# Named (optional) arguments.
parser.add_argument(
"--noindex",
action="store_true",
help="Flushes all existing database data before adding new objects.",
help="Flushes all existing database data before adding objects.",
)

def handle(self, *args, **options):
"""Main logic."""
"""Contents and callouts of the script."""
self.stdout.write('Migrating the database...')
migrate_db()

self.stdout.write('Collecting static files...')
collect_static()

self.stdout.write('Populating the v1 database...')
#quickload.populate_db()
import_v1()

self.stdout.write('Populating the v2 database...')
import_v2()

if options["noindex"]:
self.stdout.write('Skipping search index rebuild due to --noindex...')
self.stdout.write('Skipping search index rebuild due to --noindex')
else:
self.stdout.write('Rebuilding the search index...')
rebuild_index()
Expand All @@ -46,13 +43,14 @@ def import_v1() -> None:
"""Import the v1 apps' database models."""
call_command('import', '--dir', 'data/v1')


def import_v2() -> None:
"""Import the v2 apps' database models."""
call_command('import', '--dir', 'data/v2')


def migrate_db() -> None:
"""Migrate the local database as needed to incorporate new model updates."""
"""Migrate the local database as needed to incorporate new modelupdates."""
call_command('makemigrations')
call_command('migrate')

Expand Down

0 comments on commit 77b6919

Please sign in to comment.