Not logged in for API calls is not a warning

Many requests are made without being logged in, such as to get the list of plug-ins when opening the Marketplace.

Contributes to issue CURA-7501.
This commit is contained in:
Ghostkeeper 2020-10-16 14:15:18 +02:00
parent 8f9e0da400
commit df69d543a2
No known key found for this signature in database
GPG Key ID: D2A8871EE34EC59A

View File

@ -7,10 +7,9 @@ from cura.CuraApplication import CuraApplication
class UltimakerCloudScope(DefaultUserAgentScope):
"""Add an Authorization header to the request for Ultimaker Cloud Api requests.
When the user is not logged in or a token is not available, a warning will be logged
Also add the user agent headers (see DefaultUserAgentScope)
"""
Add an Authorization header to the request for Ultimaker Cloud Api requests, if available.
Also add the user agent headers (see DefaultUserAgentScope).
"""
def __init__(self, application: CuraApplication):
@ -22,7 +21,7 @@ class UltimakerCloudScope(DefaultUserAgentScope):
super().requestHook(request)
token = self._account.accessToken
if not self._account.isLoggedIn or token is None:
Logger.warning("Cannot add authorization to Cloud Api request")
Logger.debug("User is not logged in for Cloud API request to {url}".format(url = request.url().toDisplayString()))
return
header_dict = {