Private
Public Access
1
0

bug fix in RowerForm cleaning up

This commit is contained in:
Sander Roosendaal
2018-01-09 13:29:37 +01:00
parent 0187f3200e
commit d0455a97c0

View File

@@ -1238,38 +1238,59 @@ class RowerForm(ModelForm):
try:
rest = self.cleaned_data['rest']
except:
rest = int(self.data['rest'])
try:
rest = int(self.data['rest'])
except ValueError:
rest = 0
try:
ut2 = self.cleaned_data['ut2']
except:
ut2 = self.data['ut2']
try:
ut2 = self.data['ut2']
except ValueError:
ut2 = 0
try:
ut1 = self.cleaned_data['ut1']
except:
ut1 = self.data['ut1']
try:
ut1 = self.data['ut1']
except ValueError:
ut1 = 0
try:
at = self.cleaned_data['at']
except:
at = self.data['at']
try:
at = self.data['at']
except ValueError:
at = 0
try:
an = self.cleaned_data['an']
except:
an = self.data['an']
try:
an = self.data['an']
except ValueError:
an = 0
try:
tr = self.cleaned_data['tr']
except:
tr = self.data['tr']
try:
tr = self.data['tr']
except ValueError:
tr = 0
try:
max = self.cleaned_data['max']
except:
max = self.data['max']
try:
max = self.data['max']
except ValueError:
max = 0
if rest>=ut2:
raise forms.ValidationError("Resting heart rate should be lower than UT2")
if ut2>=ut1: