diff --git a/rowers/stravastuff.py b/rowers/stravastuff.py index f4b60fa7..2c8a9505 100644 --- a/rowers/stravastuff.py +++ b/rowers/stravastuff.py @@ -291,7 +291,10 @@ def get_workout(user,stravaid): workoutsummary = requests.get(url,headers=headers).json() workoutsummary['timezone'] = "Etc/UTC" - startdatetime = workoutsummary['start_date'] + try: + startdatetime = workoutsummary['start_date'] + except KeyError: + startdatetime = timezone.now() spmjson = get_strava_stream(r,'cadence',stravaid) hrjson = get_strava_stream(r,'heartrate',stravaid) diff --git a/rowers/teams.py b/rowers/teams.py index 76a9127b..d934b446 100644 --- a/rowers/teams.py +++ b/rowers/teams.py @@ -173,7 +173,9 @@ def rower_get_coaches(rower): def coach_getcoachees(coach): if coach.mycoachgroup and coach.rowerplan == 'coach': - return Rower.objects.filter(coachinggroups__in=[coach.mycoachgroup]).distinct() + return Rower.objects.filter( + coachinggroups__in=[coach.mycoachgroup] + ).distinct().order_by("user__last_name","user__first_name") else: return [] diff --git a/rowers/templates/billing.html b/rowers/templates/billing.html index ef442cb3..be3ba675 100644 --- a/rowers/templates/billing.html +++ b/rowers/templates/billing.html @@ -45,6 +45,6 @@ {% endblock %} {% block sidebar %} -{% include 'menu_profile.html' %} +{% include 'menu_payments.html' %} {% endblock %} diff --git a/rowers/templates/downgrade.html b/rowers/templates/downgrade.html index 7e5fe130..2ad91f7e 100644 --- a/rowers/templates/downgrade.html +++ b/rowers/templates/downgrade.html @@ -57,6 +57,6 @@ {% endblock %} {% block sidebar %} -{% include 'menu_profile.html' %} +{% include 'menu_payments.html' %} {% endblock %} diff --git a/rowers/templates/downgrade_completed.html b/rowers/templates/downgrade_completed.html index 4ede1451..c7fc85f2 100644 --- a/rowers/templates/downgrade_completed.html +++ b/rowers/templates/downgrade_completed.html @@ -21,6 +21,6 @@ {% endblock %} {% block sidebar %} -{% include 'menu_profile.html' %} +{% include 'menu_payments.html' %} {% endblock %} diff --git a/rowers/templates/downgradeconfirm.html b/rowers/templates/downgradeconfirm.html index 4b76a6d9..a465be46 100644 --- a/rowers/templates/downgradeconfirm.html +++ b/rowers/templates/downgradeconfirm.html @@ -98,6 +98,6 @@ {% endblock %} {% block sidebar %} -{% include 'menu_profile.html' %} +{% include 'menu_payments.html' %} {% endblock %} diff --git a/rowers/templates/menu_analytics.html b/rowers/templates/menu_analytics.html index 07c6d218..7d76a4be 100644 --- a/rowers/templates/menu_analytics.html +++ b/rowers/templates/menu_analytics.html @@ -68,7 +68,7 @@ -{% if user.is_authenticated and user|is_manager %} +{% if user.is_authenticated and user|is_manager and rower %}

 

{% if user|coach_rowers %} diff --git a/rowers/templates/menu_other.html b/rowers/templates/menu_other.html new file mode 100644 index 00000000..fad56ed0 --- /dev/null +++ b/rowers/templates/menu_other.html @@ -0,0 +1,51 @@ +{% load staticfiles %} +{% load rowerfilters %} +

Workouts

+ + + + + +{% include 'menuscript.html' %} diff --git a/rowers/templates/menu_payments.html b/rowers/templates/menu_payments.html new file mode 100644 index 00000000..91940095 --- /dev/null +++ b/rowers/templates/menu_payments.html @@ -0,0 +1,41 @@ +{% load staticfiles %} +{% load rowerfilters %} +

Profile

+ + + + +{% include 'menuscript.html' %} diff --git a/rowers/templates/menu_profile.html b/rowers/templates/menu_profile.html index 3863b35e..e3702374 100644 --- a/rowers/templates/menu_profile.html +++ b/rowers/templates/menu_profile.html @@ -37,7 +37,7 @@ -{% if user.is_authenticated and user|is_manager %} +{% if user.is_authenticated and user|is_manager and rower %}

 

{% if user|coach_rowers %}