mirror of
https://github.com/ansible/awx.git
synced 2026-05-19 23:07:42 -02:30
Group serializer special v1 functionality
Returns a related `inventory_source` and related link for groups if accessed from /api/v1/, but not for API v2. Also inserts corresponding fields to inventory source serializer. Keep migrated manual sources and auto-create in API v1.
This commit is contained in:
@@ -28,7 +28,7 @@ class Migration(migrations.Migration):
|
||||
migrations.AlterField(
|
||||
model_name='inventorysource',
|
||||
name='deprecated_group',
|
||||
field=models.ForeignKey(related_name='deprecated_inventory_source', default=None, null=True, to='main.Group'),
|
||||
field=models.OneToOneField(related_name='deprecated_inventory_source', null=True, default=None, to='main.Group'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='inventorysource',
|
||||
|
||||
@@ -19,7 +19,6 @@ class Migration(migrations.Migration):
|
||||
operations = [
|
||||
# Inventory Refresh
|
||||
migrations.RunPython(migration_utils.set_current_apps_for_migrations),
|
||||
migrations.RunPython(invsrc.remove_manual_inventory_sources),
|
||||
migrations.RunPython(invsrc.remove_inventory_source_with_no_inventory_link),
|
||||
migrations.RunPython(invsrc.rename_inventory_sources),
|
||||
]
|
||||
|
||||
@@ -10,6 +10,7 @@ def remove_manual_inventory_sources(apps, schema_editor):
|
||||
Group creation and we would use the parent Group as our interface for the user.
|
||||
During that process we would create InventorySource that had a source of "manual".
|
||||
'''
|
||||
# TODO: use this in the 3.3 data migrations
|
||||
InventorySource = apps.get_model('main', 'InventorySource')
|
||||
# see models/inventory.py SOURCE_CHOICES - ('', _('Manual'))
|
||||
logger.debug("Removing all Manual InventorySource from database.")
|
||||
|
||||
Reference in New Issue
Block a user