Merge branch 'release/13.75' into master
This commit is contained in:
+1
-1
@@ -184,7 +184,7 @@ ratelim==0.1.6
|
||||
redis==3.2.1
|
||||
requests==2.23.0
|
||||
requests-oauthlib==1.2.0
|
||||
rowingdata==2.9.1
|
||||
rowingdata==2.9.3
|
||||
rowingphysics==0.5.0
|
||||
rq==0.13.0
|
||||
rules==2.1
|
||||
|
||||
+2
-1
@@ -31,6 +31,7 @@ import dask.dataframe as dd
|
||||
from dask.delayed import delayed
|
||||
import pyarrow.parquet as pq
|
||||
import pyarrow as pa
|
||||
|
||||
from pyarrow.lib import ArrowInvalid
|
||||
|
||||
from django.utils import timezone
|
||||
@@ -2379,7 +2380,7 @@ def read_df_sql(id):
|
||||
try:
|
||||
f = 'media/strokedata_{id}.parquet.gz'.format(id=id)
|
||||
df = pd.read_parquet(f)
|
||||
except OSError:
|
||||
except (OSError,ArrowInvalid):
|
||||
rowdata,row = getrowdata(id=id)
|
||||
if rowdata and len(rowdata.df):
|
||||
data = dataprep(rowdata.df,id=id,bands=True,otwpower=True,barchart=True)
|
||||
|
||||
@@ -1531,7 +1531,7 @@ def add_workout_indoorrace(ws,race,r,recordid=0,doregister=False):
|
||||
errors.append('You must submit a indoor rowing workout')
|
||||
return 0,comments, errors, 0
|
||||
|
||||
if ws[0].weightcategory != record.weightcategory:
|
||||
if record.weightcategory == 'lwt' and ws[0].weightcategory != record.weightcategory:
|
||||
errors.append('Your workout weight category did not match the weight category you registered')
|
||||
return 0,comments, errors,0
|
||||
|
||||
@@ -1671,7 +1671,7 @@ def add_workout_race(ws,race,r,splitsecond=0,recordid=0,doregister=False):
|
||||
errors.append('Your workout boat type did not match the boat type you registered')
|
||||
return 0,comments,errors,0
|
||||
|
||||
if ws[0].weightcategory != record.weightcategory:
|
||||
if record.weightcategory == 'lwt' and ws[0].weightcategory != record.weightcategory:
|
||||
errors.append('Your workout weight category did not match the weight category you registered')
|
||||
return 0,comments, errors,0
|
||||
|
||||
|
||||
@@ -7,6 +7,8 @@ from __future__ import unicode_literals, absolute_import
|
||||
# All the functionality needed to connect to Strava
|
||||
from scipy import optimize
|
||||
from scipy.signal import savgol_filter
|
||||
import time
|
||||
from time import strftime
|
||||
|
||||
|
||||
from django_mailbox.models import Message,Mailbox,MessageAttachment
|
||||
@@ -75,6 +77,19 @@ def get_token(code):
|
||||
return imports_get_token(code, oauth_data)
|
||||
|
||||
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)
|
||||
if user.rower.strava_owner_id == 0:
|
||||
strava_owner_id = set_strava_athlete_id(user)
|
||||
|
||||
+1
-1
@@ -2739,7 +2739,7 @@ def fetch_strava_workout(stravatoken,oauth_data,stravaid,csvfilename,userid,debu
|
||||
f.write('\n')
|
||||
f.write(timestamp)
|
||||
f.write(' ')
|
||||
f.write('handle_get_garmin_file response code {code}\n'.format(code=response.status_code))
|
||||
f.write('handle_get_strava_file response code {code}\n'.format(code=response.status_code))
|
||||
f.write('Response json {json}\n'.format(json=response.json()))
|
||||
|
||||
return 0
|
||||
|
||||
Reference in New Issue
Block a user