Merge tag 'v7.33' into develop
bug fix
This commit is contained in:
@@ -39,7 +39,10 @@ from rowingdata import (
|
|||||||
summarydata, get_file_type,
|
summarydata, get_file_type,
|
||||||
)
|
)
|
||||||
|
|
||||||
from rowers.metrics import axes,calc_trimp
|
from rowers.metrics import axes,calc_trimp,rowingmetrics
|
||||||
|
|
||||||
|
allowedcolumns = [item[0] for item in rowingmetrics]
|
||||||
|
|
||||||
from async_messages import messages as a_messages
|
from async_messages import messages as a_messages
|
||||||
import os
|
import os
|
||||||
import zipfile
|
import zipfile
|
||||||
@@ -1945,6 +1948,12 @@ def fix_newtons(id=0, limit=3000):
|
|||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def remove_invalid_columns(df):
|
||||||
|
for c in df.columns:
|
||||||
|
if not c in allowedcolumns:
|
||||||
|
df.drop(labels=c,axis=1,inplace=True)
|
||||||
|
|
||||||
|
return df
|
||||||
|
|
||||||
def add_efficiency(id=0):
|
def add_efficiency(id=0):
|
||||||
rowdata, row = getrowdata_db(id=id,
|
rowdata, row = getrowdata_db(id=id,
|
||||||
@@ -1960,6 +1969,11 @@ def add_efficiency(id=0):
|
|||||||
efficiency = efficiency.replace([-np.inf, np.inf], np.nan)
|
efficiency = efficiency.replace([-np.inf, np.inf], np.nan)
|
||||||
efficiency.fillna(method='ffill')
|
efficiency.fillna(method='ffill')
|
||||||
rowdata['efficiency'] = efficiency
|
rowdata['efficiency'] = efficiency
|
||||||
|
|
||||||
|
rowdata = remove_invalid_columns(rowdata)
|
||||||
|
rowdata = rowdata.replace([-np.inf, np.inf], np.nan)
|
||||||
|
rowdata = rowdata.fillna(method='ffill')
|
||||||
|
|
||||||
delete_strokedata(id)
|
delete_strokedata(id)
|
||||||
if id != 0:
|
if id != 0:
|
||||||
rowdata['workoutid'] = id
|
rowdata['workoutid'] = id
|
||||||
|
|||||||
@@ -139,12 +139,12 @@ def imports_do_refresh_token(refreshtoken,oauth_data,access_token=''):
|
|||||||
if response.status_code == 200 or response.status_code == 201:
|
if response.status_code == 200 or response.status_code == 201:
|
||||||
token_json = response.json()
|
token_json = response.json()
|
||||||
else:
|
else:
|
||||||
raise NoTokenError
|
raise NoTokenError("User has no token")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
thetoken = token_json['access_token']
|
thetoken = token_json['access_token']
|
||||||
except KeyError:
|
except KeyError:
|
||||||
raise NoTokenError
|
raise NoTokenError("User has no token")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
expires_in = token_json['expires_in']
|
expires_in = token_json['expires_in']
|
||||||
|
|||||||
Reference in New Issue
Block a user