mirror of
https://github.com/ansible/awx.git
synced 2026-03-09 05:29:26 -02:30
Check for null attributes related to an inventory update when performing
the name migration
This commit is contained in:
@@ -9,6 +9,8 @@ class Migration(DataMigration):
|
||||
|
||||
def forwards(self, orm):
|
||||
for iu in orm.InventoryUpdate.objects.filter(active=True):
|
||||
if iu.inventory_source is None or iu.inventory_source.group is None or iu.inventory_source.inventory is None:
|
||||
continue
|
||||
iu.name = "%s (%s)" % (iu.inventory_source.group.name, iu.inventory_source.inventory.name)
|
||||
iu.save()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user