diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e9b7084b..e2162eba 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -152,14 +152,14 @@ jobs: matrix: python-version: ["3.10"] # 3.12 stable is tested in unittest_report stage. db-backend: ["postgresql"] - nautobot-version: ["stable"] + nautobot-version: ["2.4"] include: - python-version: "3.11" db-backend: "postgresql" nautobot-version: "2.4.20" - python-version: "3.12" db-backend: "mysql" - nautobot-version: "stable" + nautobot-version: "2.4" runs-on: "ubuntu-latest" env: INVOKE_NAUTOBOT_DEVICE_ONBOARDING_PYTHON_VER: "${{ matrix.python-version }}" @@ -207,7 +207,7 @@ jobs: matrix: python-version: ["3.12"] db-backend: ["postgresql"] - nautobot-version: ["stable"] + nautobot-version: ["2.4"] runs-on: "ubuntu-latest" permissions: pull-requests: "write" diff --git a/changes/458.fixed b/changes/458.fixed new file mode 100644 index 00000000..329af50e --- /dev/null +++ b/changes/458.fixed @@ -0,0 +1 @@ +Fixed migration bug where OnboardingTask was not filtered correctly. \ No newline at end of file diff --git a/nautobot_device_onboarding/migrations/0005_migrate_site_to_location_part_2.py b/nautobot_device_onboarding/migrations/0005_migrate_site_to_location_part_2.py index 74207b3a..90c84f33 100644 --- a/nautobot_device_onboarding/migrations/0005_migrate_site_to_location_part_2.py +++ b/nautobot_device_onboarding/migrations/0005_migrate_site_to_location_part_2.py @@ -5,7 +5,7 @@ def migrate_to_location(apps, schema_editor): OnboardingTask = apps.get_model("nautobot_device_onboarding", "OnboardingTask") location_model = apps.get_model("dcim", "Location") - for task_object in OnboardingTask.objects.all(): + for task_object in OnboardingTask.objects.filter(site__isnull=False): # get the new Location object from the site and set it task_object.location = location_model.objects.get(name=task_object.site.name) task_object.save()