aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ctrack/core/management/commands/populate_db.py11
-rw-r--r--ctrack/core/utils.py3
-rwxr-xr-xutility/trunc_and_populate.sh2
3 files changed, 5 insertions, 11 deletions
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")
diff --git a/utility/trunc_and_populate.sh b/utility/trunc_and_populate.sh
index 8ac3a4f..40c049b 100755
--- a/utility/trunc_and_populate.sh
+++ b/utility/trunc_and_populate.sh
@@ -6,4 +6,4 @@ sudo -u postgres psql -f utility/truncate_script.sql ctrack
sleep 1
echo "Populating the database with test data."
-python manage.py populate_db 20
+python manage.py populate_db