Skip to content

Commit 4ec109e

Browse files
committed
Backporting PR-#455
1 parent 4d3713b commit 4ec109e

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

changes/458.fixed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed migration bug where OnboardingTask was not filtered correctly.

nautobot_device_onboarding/migrations/0005_migrate_site_to_location_part_2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ def migrate_to_location(apps, schema_editor):
55
OnboardingTask = apps.get_model("nautobot_device_onboarding", "OnboardingTask")
66
location_model = apps.get_model("dcim", "Location")
77

8-
for task_object in OnboardingTask.objects.all():
8+
for task_object in OnboardingTask.objects.filter(site__isnull=False):
99
# get the new Location object from the site and set it
1010
task_object.location = location_model.objects.get(name=task_object.site.name)
1111
task_object.save()

0 commit comments

Comments
 (0)