Private
Public Access
1
0

fix notokenerror

This commit is contained in:
Sander Roosendaal
2023-01-22 10:52:16 +01:00
parent b02a2075c6
commit 54d4ed633f

View File

@@ -52,11 +52,11 @@ graphql_url = "https://rp3rowing-app.com/graphql"
def rp3_open(user):
tokenexpirydate = user.rower.rp3tokenexpirydate
if tokenexpirydate is None:
raise NoTokenError
raise NoTokenError("No Token")
if tokenexpirydate is not None and timezone.now()-timedelta(days=120)>tokenexpirydate:
user.rower.rp3tokenexpirydate = timezone.now()-timedelta(days=1)
user.rower.save()
raise NoTokenError
raise NoTokenError("No Token")
return imports_open(user, oauth_data)
# Refresh ST token using refresh token