Private
Public Access
1
0

Merge branch 'release/v18.2.0'

This commit is contained in:
Sander Roosendaal
2022-01-18 15:55:43 +01:00
8 changed files with 26 additions and 20 deletions

View File

@@ -2028,7 +2028,7 @@ def handle_nonpainsled(f2, fileformat, summary='',startdatetime='',empowerfirmwa
return (f2, summary, oarlength, inboard, fileformat, impeller)
# Create new workout from file and store it in the database
# This routine should be used everywhere in views.py
# This routine should be used everywhere in views.py
def get_workouttype_from_fit(filename,workouttype='water'):
try:
@@ -2204,8 +2204,10 @@ def new_workout_from_file(r, f2,
# Get workout type from fit & tcx
if (fileformat == 'fit'): # pragma: no cover
workouttype = get_workouttype_from_fit(f2,workouttype=workouttype)
if (fileformat == 'tcx'):
workouttype = get_workouttype_from_tcx(f2,workouttype=workouttype)
#if (fileformat == 'tcx'):
# workouttype_from_tcx = get_workouttype_from_tcx(f2,workouttype=workouttype)
# if workouttype != 'rower' and workouttype_from_tcx not in mytypes.otwtypes:
# workouttype = workouttype_from_tcx
# handle non-Painsled by converting it to painsled compatible CSV
if (fileformat != 'csv'):

View File

@@ -998,6 +998,12 @@ class Rower(models.Model):
choices=landingpages2,
verbose_name="Alternative Landing Page")
defaultlandingpage3 = models.CharField(default='workout_view',
max_length=200,
choices=landingpages2,
verbose_name="Title link on workout list")
# Access tokens
c2token = models.CharField(default='',max_length=200,blank=True,null=True)
tokenexpirydate = models.DateTimeField(blank=True,null=True)
@@ -4285,6 +4291,7 @@ class AccountRowerForm(ModelForm):
'usersmooth',
'defaultlandingpage',
'defaultlandingpage2',
'defaultlandingpage3',
'offercoaching','autojoin','emailalternatives']
widgets = {

View File

@@ -246,11 +246,16 @@ def get_polar_workouts(user):
try:
workouttype = mytypes.polaraccesslink_sports[exercise_dict['detailed-sport-info']]
except KeyError:
dologging('polar.log',exercise_dict['detailed-sport-info'])
dologging('polar.log',workouttype)
try:
workouttype = mytypes.polarmappinginv[exercise_dict['sport'].lower()]
except KeyError:
dologging('polar.log',workouttype)
pass
dologging('polar.log',workouttype)
# post file to upload api
# TODO: add workouttype

View File

@@ -90,8 +90,8 @@
{% if workout.name != '' %}
<h3>
<a
href={% url rower.defaultlandingpage id=workout.id|encode %}
title="{{ rower.defaultlandingpage|verbose }}">
href={% url rower.defaultlandingpage3 id=workout.id|encode %}
title="{{ rower.defaultlandingpage3|verbose }}">
{{ workout.name }}
</a>
</h3>

View File

@@ -10,13 +10,6 @@
<h1>Change Workflow Page Layout for {{ rower.user.first_name }} {{ rower.user.last_name }}</h1>
<ul class="main-content">
{% if workoutid %}
<li class="grid_4">
<p>
<a class="button gray small" href="/rowers/workout/{{ workoutid }}/workflow/">Return to Workout</a>
</p>
</li>
{% endif %}
<li>
<p>On this page, you can configure the content of your "Workflow" page
for each workout. If you want to remove an element, change it to "None".
@@ -32,15 +25,13 @@
<input class="grid_2 alpha button" type="submit" value="Save">
</form>
</li>
{% if workoutid %}
<li>
{% if rower.defaultlandingpage == 'workout_edit_view' %}
<p>Default landing page is Edit View. Set default landing page to</p>
<a class="button small" href="/rowers/me/workflowdefault/">Workflow View</a>
{% else %}
<p>Default landing page is Workflow View. Set default landing page to</p>
<a class="button small" href="/rowers/me/workflowdefault/">Edit View</a>
{% endif %}
<p>
<a class="button" href="/rowers/workout/{{ workoutid }}/workflow/">Return to Workout</a>
</p>
</li>
{% endif %}
</ul>

View File

@@ -789,7 +789,7 @@ def mocked_requests(*args, **kwargs):
"has-route": True,
"club-id": 999,
"club-name": "Polar Club",
"detailed-sport-info": "WATERSPORTS_WATERSKI",
"detailed-sport-info": "WALKING",
"fat-percentage": 60,
"carbohydrate-percentage": 38,
"protein-percentage": 2

View File

@@ -117,6 +117,7 @@ class UserPreferencesTest(TestCase):
'usersmooth':2,
'defaultlandingpage':'workout_edit_view',
'defaultlandingpage2':'workout_delete',
'defaultlandingpage3': 'workout_view',
'first_name': self.u.first_name,
'last_name': self.u.last_name,
'email':self.u.email

Binary file not shown.