Include error message in JSON detail response

Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Dan McGee 2015-02-26 20:01:14 -06:00
parent e739d440e9
commit 65daa766ca

View File

@ -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)