From f562569ea87f8e5c2a7e611dfe61290df597b7c1 Mon Sep 17 00:00:00 2001 From: MR Lemon Date: Wed, 13 May 2020 16:19:57 +0100 Subject: removed redundant argument from populate function --- ctrack/core/management/commands/populate_db.py | 11 +++-------- ctrack/core/utils.py | 3 +-- 2 files changed, 4 insertions(+), 10 deletions(-) (limited to 'ctrack/core') diff --git a/ctrack/core/management/commands/populate_db.py b/ctrack/core/management/commands/populate_db.py index 5b8f541..fe6aa4e 100644 --- a/ctrack/core/management/commands/populate_db.py +++ b/ctrack/core/management/commands/populate_db.py @@ -1,6 +1,5 @@ - from django.core.management import BaseCommand -from django.core.management import CommandParser + from ctrack.core.utils import populate_db @@ -9,16 +8,12 @@ class Command(BaseCommand): Creates a large test fixture. """ - def add_arguments(self, parser: CommandParser) -> None: - parser.add_argument("number", nargs=1, type=int) - def handle(self, *args, **options): - number = options["number"][0] - populate_db(number) + populate_db() # TODO - adapt this so that it records more than just Persons created self.stdout.write( self.style.SUCCESS( - f"Created {number} Person object[s]! Go forth and multiply." + f"Created test fixture successfully." ) ) diff --git a/ctrack/core/utils.py b/ctrack/core/utils.py index 039348d..1f9e518 100644 --- a/ctrack/core/utils.py +++ b/ctrack/core/utils.py @@ -51,8 +51,7 @@ def _create_caf_app_service(c_descriptors, org, q_descriptors): ) -def populate_db(persons): - number = persons +def populate_db(): # Set up some reasonable Modes and SubModes m1 = Mode.objects.create(descriptor="Rail") -- cgit v1.2.3