Merge tag 'v7.33' into develop
bug fix
This commit is contained in:
@@ -39,7 +39,10 @@ from rowingdata import (
|
||||
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
|
||||
import os
|
||||
import zipfile
|
||||
@@ -1945,6 +1948,12 @@ def fix_newtons(id=0, limit=3000):
|
||||
except KeyError:
|
||||
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):
|
||||
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.fillna(method='ffill')
|
||||
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)
|
||||
if id != 0:
|
||||
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:
|
||||
token_json = response.json()
|
||||
else:
|
||||
raise NoTokenError
|
||||
raise NoTokenError("User has no token")
|
||||
|
||||
try:
|
||||
thetoken = token_json['access_token']
|
||||
except KeyError:
|
||||
raise NoTokenError
|
||||
raise NoTokenError("User has no token")
|
||||
|
||||
try:
|
||||
expires_in = token_json['expires_in']
|
||||
|
||||
Reference in New Issue
Block a user