From 65daa766cad72f9d6271439789fc399999b3a973 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Thu, 26 Feb 2015 20:01:14 -0600 Subject: Include error message in JSON detail response Signed-off-by: Dan McGee --- mirrors/views/api.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mirrors/views/api.py b/mirrors/views/api.py index 06574082..b72585e6 100644 --- a/mirrors/views/api.py +++ b/mirrors/views/api.py @@ -45,7 +45,9 @@ def default(self, obj): check_time__gte=cutoff).order_by('check_time')) return data if isinstance(obj, MirrorLog): - return {attr: getattr(obj, attr) for attr in self.log_attributes} + data = {attr: getattr(obj, attr) for attr in self.log_attributes} + data['error'] = obj.error or None + return data return super(ExtendedMirrorStatusJSONEncoder, self).default(obj) -- cgit v1.2.3-54-g00ecf