diff --git a/main/management/commands/load_fixtures.py b/main/management/commands/load_fixtures.py index 47a091100..617f1ea53 100644 --- a/main/management/commands/load_fixtures.py +++ b/main/management/commands/load_fixtures.py @@ -7,6 +7,8 @@ def list_fixtures_in_dir(rel_path): files = os.listdir(rel_path) + # Sort the list alphabetically for consistent load-order + files.sort() def is_fixture(fn): return fn.lower()[-5:] == ".json" @@ -15,11 +17,11 @@ def is_fixture(fn): fixture_dirs = { + "main": list_fixtures_in_dir("main/fixtures/"), "proposals": list_fixtures_in_dir("proposals/fixtures/"), "studies": list_fixtures_in_dir("studies/fixtures/"), "tasks": list_fixtures_in_dir("tasks/fixtures/"), "observations": list_fixtures_in_dir("observations/fixtures/"), - "main": list_fixtures_in_dir("main/fixtures/"), } diff --git a/tasks/fixtures/registrations.json b/tasks/fixtures/00_registrations.json similarity index 100% rename from tasks/fixtures/registrations.json rename to tasks/fixtures/00_registrations.json diff --git a/tasks/fixtures/registrationkinds.json b/tasks/fixtures/01_registrationkinds.json similarity index 100% rename from tasks/fixtures/registrationkinds.json rename to tasks/fixtures/01_registrationkinds.json