mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-26 20:31:35 -07:00
Add comment to clarify usage of fallback date
This commit is contained in:
parent
a7071e2d3d
commit
14c361a297
1 changed files with 1 additions and 0 deletions
|
|
@ -94,6 +94,7 @@ class AuthorizationService:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
# Check if the current access token is expired and refresh it if that is the case.
|
# Check if the current access token is expired and refresh it if that is the case.
|
||||||
|
# We have a fallback on a date far in the past for currently stored auth data in cura.cfg.
|
||||||
received_at = datetime.strptime(self._auth_data.received_at, TOKEN_TIMESTAMP_FORMAT) \
|
received_at = datetime.strptime(self._auth_data.received_at, TOKEN_TIMESTAMP_FORMAT) \
|
||||||
if self._auth_data.received_at else datetime(2000, 1, 1)
|
if self._auth_data.received_at else datetime(2000, 1, 1)
|
||||||
expiry_date = received_at + timedelta(seconds = float(self._auth_data.expires_in or 0))
|
expiry_date = received_at + timedelta(seconds = float(self._auth_data.expires_in or 0))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue