mirror of
https://github.com/ansible/awx.git
synced 2026-03-14 07:27:28 -02:30
Merge pull request #6501 from chrismeyersfsu/fix-read_only_source_project
allow changing source_project
This commit is contained in:
@@ -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 == 'inventory':
|
||||
field_kwargs['read_only'] = True
|
||||
field_kwargs.pop('queryset', None)
|
||||
return field_class, field_kwargs
|
||||
|
||||
Reference in New Issue
Block a user