summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2015-02-26 20:01:14 -0600
committerDan McGee <dan@archlinux.org>2015-02-26 20:01:14 -0600
commit65daa766cad72f9d6271439789fc399999b3a973 (patch)
tree18c7f009203ceb03b3a1ea7454d919d1651be946
parente739d440e91ff58e2efa59f8b142a7f71fa1e77f (diff)
Include error message in JSON detail response
Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r--mirrors/views/api.py4
1 files changed, 3 insertions, 1 deletions
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 @@ class ExtendedMirrorStatusJSONEncoder(MirrorStatusJSONEncoder):
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)