Signed-off-by: Andy Doan <[email protected]>
Reviewed-by: Stephen Finucane <[email protected]>
---
patchwork/rest_serializers.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/patchwork/rest_serializers.py b/patchwork/rest_serializers.py
index 710d714..42e22ab 100644
--- a/patchwork/rest_serializers.py
+++ b/patchwork/rest_serializers.py
@@ -70,6 +70,7 @@ class PatchSerializer(HyperlinkedModelSerializer):
# there's no need to expose an entire "tags" endpoint, so we custom
# render this field
exclude = ('tags',)
+ check_names = dict(Check.STATE_CHOICES)
mbox_url = SerializerMethodField()
state = SerializerMethodField()
@@ -83,6 +84,7 @@ class PatchSerializer(HyperlinkedModelSerializer):
def to_representation(self, instance):
data = super(PatchSerializer, self).to_representation(instance)
data['checks'] = data['url'] + 'checks/'
+ data['check'] = self.check_names[instance.combined_check_state]
headers = data.get('headers')
if headers is not None:
data['headers'] = email.parser.Parser().parsestr(headers, True)
--
2.7.4
_______________________________________________
Patchwork mailing list
[email protected]
https://lists.ozlabs.org/listinfo/patchwork