diff --git a/rowers/integrations/nk.py b/rowers/integrations/nk.py index d109b415..960b2f51 100644 --- a/rowers/integrations/nk.py +++ b/rowers/integrations/nk.py @@ -224,6 +224,9 @@ class NKIntegration(SyncIntegration): "redirect_uri": NK_REDIRECT_URI, } + s = 'Authorizing NK for user {u}'.format(u = self.user.id) + dologging('nklog.log',s) + url = NK_OAUTH_LOCATION+"/oauth/authorize?"+urllib.parse.urlencode(params) return url @@ -237,14 +240,23 @@ class NKIntegration(SyncIntegration): "code": code, } - response = requests.post( - url, - auth=HTTPBasicAuth(self.oauth_data['client_id'], - self.oauth_data['client_secret']), - data=post_data - ) + try: + response = requests.post( + url, + auth=HTTPBasicAuth(self.oauth_data['client_id'], + self.oauth_data['client_secret']), + data=post_data + ) + except ConnectionError: + dologging('nklog.log','Connection error for user {u}'.format(u=self.user.id)) + raise NoTokenError("Failed to obtain token") if response.status_code != 200: + dologging('nklog.log','Response Status Code {c} for user {u}: {e}'.format( + u = self.user.id, + c = response.status_code, + e = response.text + )) raise NoTokenError("Failed to obtain token") token_json = response.json() diff --git a/rowers/templates/acc_activate_email.html b/rowers/templates/acc_activate_email.html index 2c4f4e1e..9d24320b 100644 --- a/rowers/templates/acc_activate_email.html +++ b/rowers/templates/acc_activate_email.html @@ -2,6 +2,6 @@ Hi {{ user.username }}, Please click on the link to confirm your registration, -http://{{ domain }}{% url 'useractivate' uidb64=uid token=token %} +https://{{ domain }}{% url 'useractivate' uidb64=uid token=token %} If you think, it's not you, then just ignore this email. {% endautoescape %} diff --git a/rowers/tests/testdata/testdata.tcx.gz b/rowers/tests/testdata/testdata.tcx.gz index 8239fee9..2bc3badc 100644 Binary files a/rowers/tests/testdata/testdata.tcx.gz and b/rowers/tests/testdata/testdata.tcx.gz differ