Merge tag 'v5.5' into develop
release
This commit is contained in:
@@ -1238,37 +1238,58 @@ class RowerForm(ModelForm):
|
|||||||
try:
|
try:
|
||||||
rest = self.cleaned_data['rest']
|
rest = self.cleaned_data['rest']
|
||||||
except:
|
except:
|
||||||
rest = int(self.data['rest'])
|
try:
|
||||||
|
rest = int(self.data['rest'])
|
||||||
|
except ValueError:
|
||||||
|
rest = 0
|
||||||
|
|
||||||
try:
|
try:
|
||||||
ut2 = self.cleaned_data['ut2']
|
ut2 = self.cleaned_data['ut2']
|
||||||
except:
|
except:
|
||||||
ut2 = self.data['ut2']
|
try:
|
||||||
|
ut2 = self.data['ut2']
|
||||||
|
except ValueError:
|
||||||
|
ut2 = 0
|
||||||
|
|
||||||
try:
|
try:
|
||||||
ut1 = self.cleaned_data['ut1']
|
ut1 = self.cleaned_data['ut1']
|
||||||
except:
|
except:
|
||||||
ut1 = self.data['ut1']
|
try:
|
||||||
|
ut1 = self.data['ut1']
|
||||||
|
except ValueError:
|
||||||
|
ut1 = 0
|
||||||
|
|
||||||
try:
|
try:
|
||||||
at = self.cleaned_data['at']
|
at = self.cleaned_data['at']
|
||||||
except:
|
except:
|
||||||
at = self.data['at']
|
try:
|
||||||
|
at = self.data['at']
|
||||||
|
except ValueError:
|
||||||
|
at = 0
|
||||||
|
|
||||||
try:
|
try:
|
||||||
an = self.cleaned_data['an']
|
an = self.cleaned_data['an']
|
||||||
except:
|
except:
|
||||||
an = self.data['an']
|
try:
|
||||||
|
an = self.data['an']
|
||||||
|
except ValueError:
|
||||||
|
an = 0
|
||||||
|
|
||||||
try:
|
try:
|
||||||
tr = self.cleaned_data['tr']
|
tr = self.cleaned_data['tr']
|
||||||
except:
|
except:
|
||||||
tr = self.data['tr']
|
try:
|
||||||
|
tr = self.data['tr']
|
||||||
|
except ValueError:
|
||||||
|
tr = 0
|
||||||
|
|
||||||
try:
|
try:
|
||||||
max = self.cleaned_data['max']
|
max = self.cleaned_data['max']
|
||||||
except:
|
except:
|
||||||
max = self.data['max']
|
try:
|
||||||
|
max = self.data['max']
|
||||||
|
except ValueError:
|
||||||
|
max = 0
|
||||||
|
|
||||||
if rest>=ut2:
|
if rest>=ut2:
|
||||||
raise forms.ValidationError("Resting heart rate should be lower than UT2")
|
raise forms.ValidationError("Resting heart rate should be lower than UT2")
|
||||||
|
|||||||
@@ -4126,7 +4126,7 @@ def otwrankings_view(request,theuser=0,
|
|||||||
request.session['async_tasks'] += [(job.id,'updatecpwater')]
|
request.session['async_tasks'] += [(job.id,'updatecpwater')]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
request.session['async_tasks'] = [(job.id,'updatecpwater')]
|
request.session['async_tasks'] = [(job.id,'updatecpwater')]
|
||||||
messages.info(request,'New calculation queued. Refresh page or resubmit the date form to get the result')
|
messages.info(request,'New calculation queued. Page will reload automatically. You can check the status of your calculations <a href="/rowers/jobs-status/" target="_blank">here</a>')
|
||||||
|
|
||||||
powerdf = pd.DataFrame({
|
powerdf = pd.DataFrame({
|
||||||
'Delta':delta,
|
'Delta':delta,
|
||||||
@@ -4134,7 +4134,7 @@ def otwrankings_view(request,theuser=0,
|
|||||||
})
|
})
|
||||||
|
|
||||||
if powerdf.empty:
|
if powerdf.empty:
|
||||||
messages.info(request,'Your calculations are running in the background. Please reload this page.')
|
messages.info(request,'Your calculations are running in the background. Page will reload automatically. You can check the status of your calculations <a href="/rowers/jobs-status/" target="_blank">here</a>')
|
||||||
|
|
||||||
powerdf = powerdf[powerdf['CP']>0]
|
powerdf = powerdf[powerdf['CP']>0]
|
||||||
powerdf.dropna(axis=0,inplace=True)
|
powerdf.dropna(axis=0,inplace=True)
|
||||||
@@ -4377,7 +4377,7 @@ def oterankings_view(request,theuser=0,
|
|||||||
request.session['async_tasks'] += [(job.id,'updatecp')]
|
request.session['async_tasks'] += [(job.id,'updatecp')]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
request.session['async_tasks'] = [(job.id,'updatecp')]
|
request.session['async_tasks'] = [(job.id,'updatecp')]
|
||||||
messages.info(request,'New calculation queued.')
|
messages.info(request,'New calculation queued. Page will reload automatically. You can check the status of your calculations <a href="/rowers/jobs-status/" target="_blank">here</a>')
|
||||||
|
|
||||||
powerdf = pd.DataFrame({
|
powerdf = pd.DataFrame({
|
||||||
'Delta':delta,
|
'Delta':delta,
|
||||||
@@ -4385,7 +4385,7 @@ def oterankings_view(request,theuser=0,
|
|||||||
})
|
})
|
||||||
|
|
||||||
if powerdf.empty:
|
if powerdf.empty:
|
||||||
messages.info(request,'Your calculations are running in the background. Please reload this page.')
|
messages.info(request,'Your calculations are running in the background. Page will reload automatically. You can check the status of your calculations <a href="/rowers/jobs-status/" target="_blank">here</a>')
|
||||||
|
|
||||||
powerdf = powerdf[powerdf['CP']>0]
|
powerdf = powerdf[powerdf['CP']>0]
|
||||||
powerdf.dropna(axis=0,inplace=True)
|
powerdf.dropna(axis=0,inplace=True)
|
||||||
@@ -6878,7 +6878,7 @@ def workout_otwsetpower_view(request,id=0,message="",successmessage=""):
|
|||||||
except KeyError:
|
except KeyError:
|
||||||
request.session['async_tasks'] = [(job.id,'otwsetpower')]
|
request.session['async_tasks'] = [(job.id,'otwsetpower')]
|
||||||
|
|
||||||
successmessage = 'Your calculations have been submitted. You will receive an email when they are done. You can check the status of your calculations <a href="/rowers/jobs-status/">here</a>'
|
successmessage = 'Your calculations have been submitted. You will receive an email when they are done. You can check the status of your calculations <a href="/rowers/jobs-status/" target="_blank">here</a>'
|
||||||
messages.info(request,successmessage)
|
messages.info(request,successmessage)
|
||||||
kwargs = {
|
kwargs = {
|
||||||
'id':int(id)}
|
'id':int(id)}
|
||||||
|
|||||||
Reference in New Issue
Block a user