mirror of
https://github.com/retspen/webvirtcloud
synced 2026-11-08 11:16:47 +00:00
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".
14 lines
469 B
Python
14 lines
469 B
Python
from rest_framework import serializers
|
|
|
|
|
|
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())
|