diff --git a/rowers/garmin_stuff.py b/rowers/garmin_stuff.py index 2aa59cfe..ee7d5ad8 100644 --- a/rowers/garmin_stuff.py +++ b/rowers/garmin_stuff.py @@ -56,9 +56,9 @@ def garmin_authorize(): resource_owner_secret = fetch_response.get('oauth_token_secret') authorization_url = garmin.authorization_url(base_uri) - return authorization_url + return authorization_url,resource_owner_key,resource_owner_secret -def garmin_processcallback(redirect_respones): +def garmin_processcallback(redirect_response,resource_owner_key,resource_owner_secret): garmin = OAuth1Session(oauth_data['client_id'], client_secret=oauth_data['client_secret'], ) diff --git a/rowers/templates/rower_exportsettings.html b/rowers/templates/rower_exportsettings.html index e1eda12b..d6e83040 100644 --- a/rowers/templates/rower_exportsettings.html +++ b/rowers/templates/rower_exportsettings.html @@ -34,6 +34,8 @@ The auto import and export settings only work on a alt="connect with Polar" width="130">

connect with Polar

+

connect with Garmin

diff --git a/rowers/views/importviews.py b/rowers/views/importviews.py index a75b8db7..d1b09b48 100644 --- a/rowers/views/importviews.py +++ b/rowers/views/importviews.py @@ -404,7 +404,9 @@ def rower_c2_authorize(request): # Garmin authorization @login_required() def rower_garmin_authorize(request): - authorization_url = garmin_stuff.garmin_authorize() + authorization_url,token,secret = garmin_stuff.garmin_authorize() + request.session['garmin_owner_key'] = token + request.session['garmin_owner_secret'] = secret return HttpResponseRedirect(authorization_url) # Strava Authorization @@ -716,7 +718,10 @@ def rower_process_polarcallback(request): def rower_process_garmincallback(request): r = getrower(request.user) absoluteurl = request.build_absolute_uri() - garmintoken,garminrefreshtoken = garmin_stuff.garmin_processcallback(absoluteurl) + + key = request.session['garmin_owner_key'] + secret = request.session['garmin_owner_secret'] + garmintoken,garminrefreshtoken = garmin_stuff.garmin_processcallback(absoluteurl,key,secret) r.garmintoken = garmintoken r.garminrefreshtoken = garminrefreshtoken r.save() diff --git a/static/img/Garmin_Connect_app_1024x1024-02.png b/static/img/Garmin_Connect_app_1024x1024-02.png new file mode 100644 index 00000000..eefdd46a Binary files /dev/null and b/static/img/Garmin_Connect_app_1024x1024-02.png differ diff --git a/static/img/Garmin_Connect_app_130x130.png b/static/img/Garmin_Connect_app_130x130.png new file mode 100644 index 00000000..aaac8b21 Binary files /dev/null and b/static/img/Garmin_Connect_app_130x130.png differ diff --git a/static/img/Garmin_connect_badge_print_RESOURCE_FILE-01.png b/static/img/Garmin_connect_badge_print_RESOURCE_FILE-01.png new file mode 100644 index 00000000..f37cf03b Binary files /dev/null and b/static/img/Garmin_connect_badge_print_RESOURCE_FILE-01.png differ diff --git a/static/img/garmin_badge_130.png b/static/img/garmin_badge_130.png new file mode 100644 index 00000000..55973ad4 Binary files /dev/null and b/static/img/garmin_badge_130.png differ diff --git a/static/img/garmin_badge_260.png b/static/img/garmin_badge_260.png new file mode 100644 index 00000000..879986a1 Binary files /dev/null and b/static/img/garmin_badge_260.png differ