From 018ee43fdbb02167b7d8ef88c86cc20a659d6959 Mon Sep 17 00:00:00 2001
From: Sander Roosendaal
Date: Sat, 12 Jan 2019 10:56:14 +0100
Subject: [PATCH] passing url tests
---
rowers/dataprep.py | 2 +-
rowers/management/commands/processemail.py | 4 +-
rowers/templates/plannedsessions.html | 8 +--
rowers/templates/plannedsessionscoach.html | 8 +--
rowers/templates/summary_edit.html | 10 +--
rowers/templates/windedit.html | 4 +-
rowers/templates/workout_comments.html | 4 +-
rowers/templates/workout_form.html | 4 +-
rowers/templates/workout_view.html | 8 +--
rowers/tests/statements.py | 1 +
rowers/tests/test_cpchart.py | 2 +-
rowers/tests/test_urls.py | 15 ++---
rowers/tests/testdata/testdata.csv.gz | Bin 11458 -> 11457 bytes
rowers/tests/testdata/testdata.tcx | 2 +-
rowers/urls.py | 2 +-
rowers/views.py | 75 +++++++++++----------
templates/basebase.html | 10 +--
17 files changed, 81 insertions(+), 78 deletions(-)
diff --git a/rowers/dataprep.py b/rowers/dataprep.py
index c7fe2a0b..dc236d51 100644
--- a/rowers/dataprep.py
+++ b/rowers/dataprep.py
@@ -1139,7 +1139,7 @@ def save_workout_database(f2, r, dosmooth=True, workouttype='rower',
btvalues=btvalues.to_json())
- return (encoder.encode_hex(w.id), message)
+ return (w.id, message)
parsers = {
'kinomap': KinoMapParser,
diff --git a/rowers/management/commands/processemail.py b/rowers/management/commands/processemail.py
index 84e34924..6010c55f 100644
--- a/rowers/management/commands/processemail.py
+++ b/rowers/management/commands/processemail.py
@@ -77,12 +77,12 @@ def processattachment(rower, fileobj, title, uploadoptions,testing=False):
link = settings.SITE_URL+reverse(
rower.defaultlandingpage,
kwargs = {
- 'id':workoutid[0],
+ 'id':encoder.encode_hex(workoutid[0]),
}
)
if uploadoptions and not 'error' in uploadoptions:
- workout = Workout.objects.get(id=encoder.decode_hex(workoutid[0]))
+ workout = Workout.objects.get(id=workoutid[0])
uploads.make_private(workout, uploadoptions)
uploads.set_workouttype(workout, uploadoptions)
uploads.do_sync(workout, uploadoptions)
diff --git a/rowers/templates/plannedsessions.html b/rowers/templates/plannedsessions.html
index e59befdd..573df861 100644
--- a/rowers/templates/plannedsessions.html
+++ b/rowers/templates/plannedsessions.html
@@ -142,20 +142,20 @@
{% if workout.user.user == user or user == team.manager %}
{% if workout.name != '' %}
|
-
+
{{ workout.name }}
|
{% else %}
- No Name
+ No Name
|
{% endif %}
{% else %}
{% if workout.name != '' %}
- {{ workout.name }} |
+ {{ workout.name }} |
{% else %}
- No Name |
+ No Name |
{% endif %}
{% endif %}
{{ workout.workouttype }} |
diff --git a/rowers/templates/plannedsessionscoach.html b/rowers/templates/plannedsessionscoach.html
index e582e40d..52c01504 100644
--- a/rowers/templates/plannedsessionscoach.html
+++ b/rowers/templates/plannedsessionscoach.html
@@ -97,20 +97,20 @@
{% if workout.user.user == user or user == team.manager %}
{% if workout.name != '' %}
-
+
{{ workout.name }}
|
{% else %}
- No Name
+ No Name
|
{% endif %}
{% else %}
{% if workout.name != '' %}
- {{ workout.name }} |
+ {{ workout.name }} |
{% else %}
- No Name |
+ No Name |
{% endif %}
{% endif %}
{{ workout.workouttype }} |
diff --git a/rowers/templates/summary_edit.html b/rowers/templates/summary_edit.html
index b40482cd..58caafad 100644
--- a/rowers/templates/summary_edit.html
+++ b/rowers/templates/summary_edit.html
@@ -30,7 +30,7 @@
| Public link to this workout |
- https://rowsandall.com/rowers/workout/{{ workout.id }}
+ https://rowsandall.com/rowers/workout/{{ workout.id|encode }}
|
|
@@ -38,7 +38,7 @@
See the how-to at the bottom of this page for details on how to use this form.
-
{% endfor %}
-