[Patchew-devel] [PATCH] rest: relieve some constraints on results

Paolo Bonzini pbonzini at redhat.com
Wed Nov 28 08:32:44 UTC 2018


Logs are optional, and the git base should not be present if pending
or running.

Signed-off-by: Paolo Bonzini <pbonzini at redhat.com>
---
 api/rest.py | 2 +-
 mods/git.py | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/api/rest.py b/api/rest.py
index 817f30f..573cbf1 100644
--- a/api/rest.py
+++ b/api/rest.py
@@ -565,7 +565,7 @@ class ResultSerializerFull(ResultSerializer):
         read_only_fields = ResultSerializer.Meta.read_only_fields
 
     # The database field is log_xz, so this is needed here
-    log = CharField(required=False)
+    log = CharField(required=False, allow_null=True, allow_blank=True)
 
 
 class ResultsViewSet(mixins.ListModelMixin, mixins.RetrieveModelMixin,
diff --git a/mods/git.py b/mods/git.py
index a37de57..2c17fc1 100644
--- a/mods/git.py
+++ b/mods/git.py
@@ -45,7 +45,8 @@ class GitLogViewer(LogView):
         return obj.git_result
 
 class ResultDataSerializer(serializers.Serializer):
-    base = CharField()
+    # TODO: should be present iff the result is success or failure
+    base = CharField(required=False)
 
     # TODO: should be present iff the result is a success
     repo = CharField(required=False)
-- 
2.19.1




More information about the Patchew-devel mailing list