diff --git a/rowers/templates/trainingplan.html b/rowers/templates/trainingplan.html
index 072dd756..1d29b18e 100644
--- a/rowers/templates/trainingplan.html
+++ b/rowers/templates/trainingplan.html
@@ -70,7 +70,7 @@
{{ macrocycle.0.name }} ({{ macrocycle.0.startdate }} - {{ macrocycle.0.enddate }})
- {% if macrocycle.0.type == 'userdefined' %}
+ {% if macrocycle.0.type == 'userdefined' and macrocycle.0.plan.status %}
|
dist (m) |
@@ -180,7 +180,7 @@
Meso {{ mesocycle.0.name }} ({{ mesocycle.0.startdate }} - {{ mesocycle.0.enddate }})
- {% if mesocycle.0.type == 'userdefined' %}
+ {% if mesocycle.0.type == 'userdefined' and mesocycle.0.plan.plan.status %}
|
dist (m) |
@@ -259,7 +259,7 @@
{% if todays_date <= microcycle.enddate|date:"Y-m-d" %}
- {% if microcycle.plan.type == 'userdefined' %}
+ {% if microcycle.plan.type == 'userdefined' %}
| |
@@ -276,7 +276,7 @@
{% endif %}
{% else %}
- {% if microcycle.plan.type == 'userdefined' %}
+ {% if microcycle.plan.type == 'userdefined' %}
| |
@@ -299,6 +299,7 @@
Micro {{ microcycle.name }} ({{ microcycle.startdate }} - {{ microcycle.enddate }})
+ {% if microcycle.plan.plan.plan.status %}
|
dist (m) |
@@ -320,6 +321,7 @@
{{ microcycle.actualrscore }} |
{{ microcycle.actualtrimp }} |
+ {% endif %}
{% if todays_date <= microcycle.enddate|date:"Y-m-d" %}
| |
diff --git a/rowers/templates/trainingplan_create.html b/rowers/templates/trainingplan_create.html
index 69086bde..76c4d07e 100644
--- a/rowers/templates/trainingplan_create.html
+++ b/rowers/templates/trainingplan_create.html
@@ -73,13 +73,13 @@
{{ plan.name }} |
{% if plan.status %} active {% else %} inactive {% endif %} |
- {% if request.user == plan.manager %}
+ {% if request.user.rower == plan.manager %}
Edit
{% endif %}
|
Plan |
- {% if request.user == plan.manager %}
+ {% if request.user.rower == plan.manager %}
Delete
{% endif %}
|
diff --git a/rowers/views.py b/rowers/views.py
index 3fe9813a..cb9e6023 100644
--- a/rowers/views.py
+++ b/rowers/views.py
@@ -16597,8 +16597,6 @@ def rower_trainingplan_view(request,
type='userdefined').order_by("startdate")
- r = plan.rower
-
for m in macrocycles:
createmesofillers(m)
m.plantime = 0
@@ -16631,7 +16629,7 @@ def rower_trainingplan_view(request,
for mm in microcycles:
sps = PlannedSession.objects.filter(
- rower = plan.rower,
+ rower = r,
startdate__lte=mm.enddate,
enddate__gte=mm.startdate)