mirror of
https://github.com/ansible/awx.git
synced 2026-02-25 23:16:01 -03:30
mprove error message when changing an inventory from regular -> smart
see: https://github.com/ansible/awx/issues/5744 Co-Authored-By: kldavis52 <kyle.linnard.davis@gmail.com>
This commit is contained in:
@@ -134,7 +134,8 @@ class InventoryDetail(RelatedJobsPreventDeleteMixin, ControlledByScmMixin, Retri
|
|||||||
|
|
||||||
# Do not allow changes to an Inventory kind.
|
# Do not allow changes to an Inventory kind.
|
||||||
if kind is not None and obj.kind != kind:
|
if kind is not None and obj.kind != kind:
|
||||||
return self.http_method_not_allowed(request, *args, **kwargs)
|
return Response(dict(error=_('You cannot turn a regular inventory into a "smart" inventory.')),
|
||||||
|
status=status.HTTP_405_METHOD_NOT_ALLOWED)
|
||||||
return super(InventoryDetail, self).update(request, *args, **kwargs)
|
return super(InventoryDetail, self).update(request, *args, **kwargs)
|
||||||
|
|
||||||
def destroy(self, request, *args, **kwargs):
|
def destroy(self, request, *args, **kwargs):
|
||||||
|
|||||||
Reference in New Issue
Block a user