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.
This commit is contained in:
Ghostkeeper 2021-11-19 17:09:33 +01:00
parent 9895015235
commit ffb891fb69
No known key found for this signature in database
GPG key ID: D2A8871EE34EC59A

View file

@ -118,7 +118,7 @@ class AuthorizationHelpers:
check_token_url, check_token_url,
headers_dict = headers, headers_dict = headers,
callback = lambda reply: self._parseUserProfile(reply, success_callback, failed_callback), 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: def _parseUserProfile(self, reply: QNetworkReply, success_callback: Optional[Callable[[UserProfile], None]], failed_callback: Optional[Callable[[], None]] = None) -> None: