From 6f99837db575648ffee21715acefd218d7046de0 Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Fri, 9 Jul 2021 21:17:33 +0200 Subject: [PATCH] Fix typing. part of CURA-8138 --- plugins/DigitalLibrary/src/DigitalFactoryApiClient.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/DigitalLibrary/src/DigitalFactoryApiClient.py b/plugins/DigitalLibrary/src/DigitalFactoryApiClient.py index 0140d9858d..3560182aa0 100644 --- a/plugins/DigitalLibrary/src/DigitalFactoryApiClient.py +++ b/plugins/DigitalLibrary/src/DigitalFactoryApiClient.py @@ -58,7 +58,7 @@ class DigitalFactoryApiClient: self._projects_pagination_mgr = PaginationManager(limit = projects_limit_per_page) if projects_limit_per_page else None # type: Optional[PaginationManager] - def checkUserHasAccess(self, callback: Callable) -> bool: + def checkUserHasAccess(self, callback: Callable) -> None: """Checks if the user has any sort of access to the digital library. A user is considered to have access if the max-# of private projects is greater then 0 (or -1 for unlimited). """ @@ -66,6 +66,7 @@ class DigitalFactoryApiClient: def callbackWrap(response: Optional[Any] = None, *args, **kwargs) -> None: if response and isinstance(response, DigitalFactoryFeatureBudgetResponse): callback( + response.library_max_private_projects is not None and response.library_max_private_projects == -1 or # Note: -1 is unlimited response.library_max_private_projects > 0) else: