mirror of
https://github.com/ansible/awx.git
synced 2026-01-22 06:58:06 -03:30
allow changing source_project
* scm project backed inventory now allows source_project to be mutated. We reset the tracked revision when this happens.
This commit is contained in:
parent
fe499c0dca
commit
2317687468
@ -1615,7 +1615,7 @@ class InventorySourceSerializer(UnifiedJobTemplateSerializer, InventorySourceOpt
|
||||
def build_relational_field(self, field_name, relation_info):
|
||||
field_class, field_kwargs = super(InventorySourceSerializer, self).build_relational_field(field_name, relation_info)
|
||||
# SCM Project and inventory are read-only unless creating a new inventory.
|
||||
if self.instance and field_name in ['source_project', 'inventory']:
|
||||
if self.instance and field_name in ['inventory',]:
|
||||
field_kwargs['read_only'] = True
|
||||
field_kwargs.pop('queryset', None)
|
||||
return field_class, field_kwargs
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user