diff --git a/rowers/models.py b/rowers/models.py
index a096c2a5..737dd97b 100644
--- a/rowers/models.py
+++ b/rowers/models.py
@@ -1495,7 +1495,8 @@ class Workout(models.Model):
plannedsession = models.ForeignKey(PlannedSession, blank=True,null=True)
name = models.CharField(max_length=150)
date = models.DateField()
- workouttype = models.CharField(choices=workouttypes,max_length=50)
+ workouttype = models.CharField(choices=workouttypes,max_length=50,
+ verbose_name='Exercise/Boat Class')
workoutsource = models.CharField(max_length=100,
default='unknown')
boattype = models.CharField(choices=boattypes,max_length=50,
@@ -1508,7 +1509,11 @@ class Workout(models.Model):
max_length=100)
distance = models.IntegerField(default=0,blank=True)
duration = models.TimeField(default=1,blank=True)
- weightcategory = models.CharField(default="hwt",max_length=10,choices=weightcategories)
+ weightcategory = models.CharField(
+ default="hwt",
+ max_length=10,
+ choices=weightcategories,
+ verbose_name='Weight Category')
weightvalue = models.FloatField(default=80.0,blank=True,verbose_name = 'Average Crew Weight (kg)')
csvfilename = models.CharField(blank=True,max_length=150)
uploadedtoc2 = models.IntegerField(default=0)
@@ -1794,7 +1799,7 @@ class WorkoutForm(ModelForm):
# duration = forms.TimeInput(format='%H:%M:%S.%f')
class Meta:
model = Workout
- fields = ['name','date','starttime','timezone','duration','distance','workouttype','weightcategory','notes','privacy','rankingpiece','boattype']
+ fields = ['name','date','starttime','timezone','duration','distance','workouttype','boattype','weightcategory','notes','privacy','rankingpiece']
widgets = {
'date': AdminDateWidget(),
'notes': forms.Textarea,
@@ -1806,7 +1811,7 @@ class WorkoutForm(ModelForm):
# this line to be removed
del self.fields['privacy']
- if self.instance.workouttype != 'water':
+ if self.instance.workouttype not in types.otwtypes:
del self.fields['boattype']
fieldorder = (
diff --git a/rowers/polarstuff.py b/rowers/polarstuff.py
index 60aad0d8..9b9c0e9e 100644
--- a/rowers/polarstuff.py
+++ b/rowers/polarstuff.py
@@ -145,6 +145,8 @@ def get_polar_notifications():
return available_data
+from rowers.utils import isprorower
+
def get_all_new_workouts(available_data,testing=False):
for record in available_data:
if testing:
@@ -153,7 +155,7 @@ def get_all_new_workouts(available_data,testing=False):
try:
r = Rower.objects.get(polaruserid=record['user-id'])
u = r.user
- if r.polar_auto_import:
+ if r.polar_auto_import and isprorower(r):
exercise_list = get_polar_workouts(u)
if testing:
print exercise_list
diff --git a/rowers/templates/document_form.html b/rowers/templates/document_form.html
index 8ca2c488..6c899e79 100644
--- a/rowers/templates/document_form.html
+++ b/rowers/templates/document_form.html
@@ -78,6 +78,28 @@
{% block scripts %}
+
+