From 87e3c19f7c30bbe1f958b48460c16c220444c5ba Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Sun, 10 Dec 2017 11:05:20 +0100 Subject: [PATCH] some bug fixes --- rowers/stravastuff.py | 5 ++++- rowers/views.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/rowers/stravastuff.py b/rowers/stravastuff.py index d1e1ac86..e53fa108 100644 --- a/rowers/stravastuff.py +++ b/rowers/stravastuff.py @@ -311,7 +311,10 @@ def handle_stravaexport(f2,workoutname,stravatoken,description='', # description doesn't work yet. Have to wait for stravalib to update if res: - act = client.update_activity(res.id,activity_type=activity_type,description=description,device_name='Rowsandall.com') + try: + act = client.update_activity(res.id,activity_type=activity_type,description=description,device_name='Rowsandall.com') + except TypeError: + act = client.update_activity(res.id,activity_type=activity_type,description=description) else: message = 'Strava activity update timed out.' return (0,message) diff --git a/rowers/views.py b/rowers/views.py index 4c212de6..bf5f555a 100644 --- a/rowers/views.py +++ b/rowers/views.py @@ -7462,7 +7462,10 @@ def workout_flexchart3_view(request,*args,**kwargs): if not request.user.is_anonymous(): r = getrower(request.user) if favoritenr>=0 and r.showfavoritechartnotes: - favoritechartnotes = favorites[favoritenr].notes + try: + favoritechartnotes = favorites[favoritenr].notes + except IndexError: + favoritechartnotes = '' else: favoritechartnotes = '' else: