Don't add disable_logging to the string representation of the Response object unless it's set
This commit is contained in:
parent
fb93aec3ec
commit
f6221a798a
1 changed files with 7 additions and 3 deletions
|
@ -63,18 +63,22 @@ class Response(Message):
|
||||||
the message into a UTF-8 JSON string
|
the message into a UTF-8 JSON string
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return json.dumps({
|
response_dict = {
|
||||||
'id' : self.id,
|
'id' : self.id,
|
||||||
'type' : 'response',
|
'type' : 'response',
|
||||||
'target' : self.target if hasattr(self, 'target') else None,
|
'target' : self.target if hasattr(self, 'target') else None,
|
||||||
'origin' : self.origin if hasattr(self, 'origin') else None,
|
'origin' : self.origin if hasattr(self, 'origin') else None,
|
||||||
'_timestamp' : self.timestamp,
|
'_timestamp' : self.timestamp,
|
||||||
'_disable_logging' : self.disable_logging,
|
|
||||||
'response' : {
|
'response' : {
|
||||||
'output' : self.output,
|
'output' : self.output,
|
||||||
'errors' : self.errors,
|
'errors' : self.errors,
|
||||||
},
|
},
|
||||||
})
|
}
|
||||||
|
|
||||||
|
if self.disable_logging:
|
||||||
|
response_dict['_disable_logging'] = self.disable_logging
|
||||||
|
|
||||||
|
return json.dumps(response_dict)
|
||||||
|
|
||||||
|
|
||||||
# vim:sw=4:ts=4:et:
|
# vim:sw=4:ts=4:et:
|
||||||
|
|
Loading…
Reference in a new issue