AC-1122 Fixed inventory source name (and therefore inventory update name) to pull from group/inventory name.

This commit is contained in:
Chris Church
2014-04-03 14:19:48 -04:00
parent 641c8d8e05
commit 9b33057042
2 changed files with 21 additions and 5 deletions
+3 -3
View File
@@ -25,11 +25,11 @@ class Migration(DataMigration):
if hasattr(instance, 'name'):
d['name'] = instance.name
elif getattr(instance, 'inventory', None) and getattr(instance, 'group', None):
d['name'] = ': '.join([instance.inventory.name, instance.group.name])
d['name'] = '%s (%s)'.join([instance.group.name, instance.inventory.name])
elif getattr(instance, 'inventory', None):
d['name'] = u'%s-%s' % (instance.inventory.name, instance.pk)
d['name'] = u'%s (%s)' % (instance.inventory.name, instance.pk)
else:
d['name'] = u'%s-%s' % (instance._meta.verbose_name, instance.pk)
d['name'] = u'%s (%s)' % (instance._meta.verbose_name, instance.pk)
return d
def _get_dict_from_common_task_model(self, instance):