Fix server error from DAB ValidationError with strings #15312
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
SUMMARY
Took me a while to process,
msg_data
is not what gets used in the response. It is only used for a log message. This threw errors when DAB coderaise ValidationError('foo')
, because of a baked-in assumption that when it gets a list (this is converted to a list of element 1) it is a list of dictionaries.I'm not defending the specific error formatting in these cases, but that's a different subject. This fixes the server error that comes from logic to build a log message that doesn't even go in the response. However we format the error, we should not return a 500.
AAP-25540
MORE CONTEXT:
This is happening because we have a DAB view (role user assignment list) which re-parents itself under the main AWX generic API view. It's weird. This allows DAB views to inherit request finalization logic (like this) but also can expose corner cases from assumptions that were always true in AWX but not always true generally.
ISSUE TYPE
COMPONENT NAME