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