mirror of
https://github.com/ansible/awx.git
synced 2026-02-26 07:26:03 -03:30
Remove uneditable Instance fields from API browser
This commit is contained in:
@@ -344,6 +344,13 @@ class InstanceDetail(RetrieveUpdateAPIView):
|
|||||||
model = models.Instance
|
model = models.Instance
|
||||||
serializer_class = serializers.InstanceSerializer
|
serializer_class = serializers.InstanceSerializer
|
||||||
|
|
||||||
|
def update_raw_data(self, data):
|
||||||
|
# these fields are only valid on creation of an instance, so they unwanted on detail view
|
||||||
|
data.pop('listener_port', None)
|
||||||
|
data.pop('node_type', None)
|
||||||
|
data.pop('hostname', None)
|
||||||
|
return super(InstanceDetail, self).update_raw_data(data)
|
||||||
|
|
||||||
def update(self, request, *args, **kwargs):
|
def update(self, request, *args, **kwargs):
|
||||||
r = super(InstanceDetail, self).update(request, *args, **kwargs)
|
r = super(InstanceDetail, self).update(request, *args, **kwargs)
|
||||||
if status.is_success(r.status_code):
|
if status.is_success(r.status_code):
|
||||||
|
|||||||
Reference in New Issue
Block a user