From 70d1bb893c3f424f0ce9b211e53ae08ddfe39012 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sat, 25 Feb 2023 01:58:09 +0100 Subject: [PATCH] A cleaner way of calculating the `success` response attribute. --- platypush/message/response/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platypush/message/response/__init__.py b/platypush/message/response/__init__.py index 6cc3beea8..e8844e408 100644 --- a/platypush/message/response/__init__.py +++ b/platypush/message/response/__init__.py @@ -78,7 +78,7 @@ class Response(Message): the message into a UTF-8 JSON string """ output = ( - self.output if self.output is not None else {'success': bool(self.errors)} + self.output if self.output is not None else {'success': not self.errors} ) response_dict = {