1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-11 12:46:49 +00:00

fix(api): a VM action answers with what the page would have shown after it

The API's VM actions call the web views and only looked at the status
code; the views report a partial result (a disk that was not deleted or
was kept, a template that was not started) as a message for the page
they redirect to. The API reported plain success and left the messages in
the session. Its answer now carries them in "messages".
This commit is contained in:
catborise 2026-11-05 16:02:50 +03:00
parent ff2182524f
commit 3fed1d04b4
3 changed files with 33 additions and 9 deletions

View file

@ -5,3 +5,10 @@ class StatusSerializer(serializers.Serializer):
"""Response body of API actions that only report a status message."""
status = serializers.CharField()
class ActionStatusSerializer(StatusSerializer):
"""A VM action's status and what the web page would have shown after it,
such as a disk that was kept or a template that was not started."""
messages = serializers.ListField(child=serializers.CharField())