adding some logging
This commit is contained in:
@@ -7,6 +7,8 @@ from __future__ import unicode_literals, absolute_import
|
|||||||
# All the functionality needed to connect to Strava
|
# All the functionality needed to connect to Strava
|
||||||
from scipy import optimize
|
from scipy import optimize
|
||||||
from scipy.signal import savgol_filter
|
from scipy.signal import savgol_filter
|
||||||
|
import time
|
||||||
|
from time import strftime
|
||||||
|
|
||||||
|
|
||||||
from django_mailbox.models import Message,Mailbox,MessageAttachment
|
from django_mailbox.models import Message,Mailbox,MessageAttachment
|
||||||
@@ -75,6 +77,19 @@ def get_token(code):
|
|||||||
return imports_get_token(code, oauth_data)
|
return imports_get_token(code, oauth_data)
|
||||||
|
|
||||||
def strava_open(user):
|
def strava_open(user):
|
||||||
|
t = time.localtime()
|
||||||
|
timestamp = time.strftime('%b-%d-%Y_%H%M', t)
|
||||||
|
with open('strava_webhooks.log','a') as f:
|
||||||
|
f.write('\n')
|
||||||
|
f.write(timestamp)
|
||||||
|
f.write(' ')
|
||||||
|
f.write('Getting token for user ')
|
||||||
|
f.write(str(user.rower.id))
|
||||||
|
f.write(' token expiry ')
|
||||||
|
f.write(str(user.rower.stravatokenexpirydate))
|
||||||
|
f.write(' ')
|
||||||
|
f.write(json.dumps(oauth_data))
|
||||||
|
f.write('\n')
|
||||||
token = imports_open(user, oauth_data)
|
token = imports_open(user, oauth_data)
|
||||||
if user.rower.strava_owner_id == 0:
|
if user.rower.strava_owner_id == 0:
|
||||||
strava_owner_id = set_strava_athlete_id(user)
|
strava_owner_id = set_strava_athlete_id(user)
|
||||||
|
|||||||
Reference in New Issue
Block a user