mirror of
https://github.com/ansible/awx.git
synced 2026-01-13 02:50:02 -03:30
Merge pull request #6287 from chrismeyersfsu/fix-insights_system_id_host
allow insights_system_id to be set to null via api
This commit is contained in:
commit
527078edb4
@ -1174,6 +1174,7 @@ class InventoryScriptSerializer(InventorySerializer):
|
||||
|
||||
class HostSerializer(BaseSerializerWithVariables):
|
||||
show_capabilities = ['edit', 'delete']
|
||||
insights_system_id = serializers.CharField(allow_blank=True, allow_null=True, required=False, default=None)
|
||||
|
||||
class Meta:
|
||||
model = Host
|
||||
|
||||
@ -243,8 +243,4 @@ class Migration(migrations.Migration):
|
||||
name='insights_system_id',
|
||||
field=models.TextField(default=None, help_text='Red Hat Insights host unique identifier.', null=True, db_index=True, blank=True),
|
||||
),
|
||||
migrations.AlterUniqueTogether(
|
||||
name='host',
|
||||
unique_together=set([('insights_system_id', 'inventory'), ('name', 'inventory')]),
|
||||
),
|
||||
]
|
||||
|
||||
@ -353,7 +353,7 @@ class Host(CommonModelNameNotUnique):
|
||||
|
||||
class Meta:
|
||||
app_label = 'main'
|
||||
unique_together = (("name", "inventory"), ("insights_system_id", "inventory"),) # FIXME: Add ('instance_id', 'inventory') after migration.
|
||||
unique_together = (("name", "inventory"),) # FIXME: Add ('instance_id', 'inventory') after migration.
|
||||
ordering = ('name',)
|
||||
|
||||
inventory = models.ForeignKey(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user