mirror of
https://github.com/ansible/awx.git
synced 2026-05-17 22:37:41 -02:30
Capture attrs keys before _build_mock_obj mutates them
_build_mock_obj() pops pseudo-fields (limit, scm_branch, job_tags, etc.) from attrs. Computing requested_prompt_fields after the pop would miss those fields and skip their ask_on_launch validation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -4142,10 +4142,12 @@ class LaunchConfigurationBaseSerializer(BaseSerializer):
|
|||||||
attrs['extra_data'][key] = db_extra_data[key]
|
attrs['extra_data'][key] = db_extra_data[key]
|
||||||
|
|
||||||
# Build unsaved version of this config, use it to detect prompts errors
|
# Build unsaved version of this config, use it to detect prompts errors
|
||||||
|
# Capture keys before _build_mock_obj pops pseudo-fields from attrs
|
||||||
|
incoming_attr_keys = set(attrs.keys())
|
||||||
mock_obj = self._build_mock_obj(attrs)
|
mock_obj = self._build_mock_obj(attrs)
|
||||||
ask_mapping_keys = set(ujt.get_ask_mapping().keys())
|
ask_mapping_keys = set(ujt.get_ask_mapping().keys())
|
||||||
requested_prompt_fields = set(attrs.keys()) & ask_mapping_keys
|
requested_prompt_fields = incoming_attr_keys & ask_mapping_keys
|
||||||
if 'extra_data' in attrs:
|
if 'extra_data' in incoming_attr_keys:
|
||||||
requested_prompt_fields.add('extra_vars')
|
requested_prompt_fields.add('extra_vars')
|
||||||
|
|
||||||
# prompts_dict() pulls persisted M2M state (labels, credentials,
|
# prompts_dict() pulls persisted M2M state (labels, credentials,
|
||||||
|
|||||||
Reference in New Issue
Block a user