decompme / decomp.me

Collaborative decompilation and reverse engineering website
https://decomp.me
MIT License
348 stars 108 forks source link

fix: profile field serialization in compiler view #1273

Closed axel7083 closed 3 weeks ago

axel7083 commented 3 weeks ago

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.

https://github.com/decompme/decomp.me/blob/294a2dc1b9fe1d6a033e07d88c92bf4a885d4769/backend/coreapp/serializers.py#L56-L58

However, in this specific context (serialiazing the owner field of a custom preset we include for a platform), it is not available. image

We can clearly notice however that the serialize_profile function is not using the request argument we are sending, it uses the profile only. Therefore an easy fix is to remove the request.

Tests