Fix mypy complaint again

Mypy doesn't recognize that the check for `None` has happened before calling the `callbackWrap` (before the get request has been made).

CURA-8112
This commit is contained in:
Konstantinos Karmas 2021-07-14 13:08:51 +02:00
parent 300176cdc6
commit 7027a8f904

View file

@ -92,7 +92,7 @@ class DigitalFactoryApiClient:
if isinstance(response, DigitalFactoryProjectResponse): # The user has only one private project
callback(True)
elif isinstance(response, list) and all(isinstance(r, DigitalFactoryProjectResponse) for r in response):
callback(len(response) < self._library_max_private_projects)
callback(len(response) < cast(int, self._library_max_private_projects))
else:
Logger.warning(f"Digital Factory: Incorrect response type received when requesting private projects: {str(response)}")
callback(False)