fix: profile field serialization in compiler view #1273
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.
Description
When creating custom presets, the
/api/compiler
is including the presets for each platforms, however when serialiazing the owner field a KeyError is raised.As visible in the code bellow, we are tyring to get the
request
from the context.decomp.me/backend/coreapp/serializers.py
Lines 56 to 58 in 294a2dc
However, in this specific context (serialiazing the owner field of a custom preset we include for a platform), it is not available.
We can clearly notice however that the
serialize_profile
function is not using the request argument we are sending, it uses theprofile
only. Therefore an easy fix is to remove the request.Tests