mirror of
https://github.com/ansible/awx.git
synced 2026-01-13 19:10:07 -03:30
Check for null attributes related to an inventory update when performing
the name migration
This commit is contained in:
parent
d27d8845ea
commit
69aa991499
@ -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()
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user