From ffb891fb69ef6b06dffaa46f25dccef048b5f7aa Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 19 Nov 2021 17:09:33 +0100 Subject: [PATCH] Fix call to failed_callback It provides 2 arguments (reply and error) which we both ignore and proceed to call failed_callback. And failed_callback may also be None in which case we don't call anything. Contributes to issue CURA-8539. --- cura/OAuth2/AuthorizationHelpers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cura/OAuth2/AuthorizationHelpers.py b/cura/OAuth2/AuthorizationHelpers.py index 516fcde932..d84da46c5f 100644 --- a/cura/OAuth2/AuthorizationHelpers.py +++ b/cura/OAuth2/AuthorizationHelpers.py @@ -118,7 +118,7 @@ class AuthorizationHelpers: check_token_url, headers_dict = headers, callback = lambda reply: self._parseUserProfile(reply, success_callback, failed_callback), - error_callback = lambda _: failed_callback() + error_callback = lambda _, _2: failed_callback() if failed_callback is not None else None ) def _parseUserProfile(self, reply: QNetworkReply, success_callback: Optional[Callable[[UserProfile], None]], failed_callback: Optional[Callable[[], None]] = None) -> None: