Time data does not match format '%Y-%m-%dT%H:%M:%S.%fZ'
Bug: #1659807 Change-Id: Iec6bf294562d9df8d2db7dbd212b7d35e91ad43a Sem-Ver: bugfix
This commit is contained in:
parent
80ef20c334
commit
e107158e9b
@ -45,11 +45,25 @@ class Token(SynergyObject):
|
||||
token.setId(id)
|
||||
|
||||
data = data["token"]
|
||||
token.setCreation(datetime.strptime(data["issued_at"],
|
||||
"%Y-%m-%dT%H:%M:%S.%fZ"))
|
||||
issued_at = None
|
||||
expires_at = None
|
||||
|
||||
token.setExpiration(datetime.strptime(data["expires_at"],
|
||||
"%Y-%m-%dT%H:%M:%S.%fZ"))
|
||||
try:
|
||||
issued_at = datetime.strptime(data["issued_at"],
|
||||
"%Y-%m-%dT%H:%M:%S.%fZ")
|
||||
except Exception:
|
||||
issued_at = datetime.strptime(data["issued_at"],
|
||||
"%Y-%m-%dT%H:%M:%S.%f")
|
||||
|
||||
try:
|
||||
expires_at = datetime.strptime(data["expires_at"],
|
||||
"%Y-%m-%dT%H:%M:%S.%fZ")
|
||||
except Exception:
|
||||
expires_at = datetime.strptime(data["expires_at"],
|
||||
"%Y-%m-%dT%H:%M:%S.%f")
|
||||
|
||||
token.setCreation(issued_at)
|
||||
token.setExpiration(expires_at)
|
||||
|
||||
project = Project()
|
||||
project.setId(data["project"]["id"])
|
||||
|
Loading…
x
Reference in New Issue
Block a user