Private
Public Access
1
0

trainingpeaks to production

This commit is contained in:
Sander Roosendaal
2017-05-08 18:10:18 +02:00
parent 4b80e30b74
commit 358782fc0f
5 changed files with 6 additions and 9 deletions

View File

@@ -406,7 +406,6 @@ class Workout(models.Model):
uploadedtounderarmour = models.IntegerField(default=0)
uploadedtotp = models.IntegerField(default=0)
uploadedtorunkeeper = models.IntegerField(default=0)
runkeeperuri = models.CharField(default='',max_length=200)
# empower stuff
inboard = models.FloatField(default=0.88)

View File

@@ -356,7 +356,6 @@ def workout_runkeeper_upload(user,w):
rkid = getidfromresponse(response)
rkuri = geturifromid(thetoken,rkid)
w.uploadedtorunkeeper = rkid
w.runkeeperuri = rkuri
w.save()
return '',rkid
else:

View File

@@ -142,7 +142,7 @@
{% endif %}
{% else %}
<div class="grid_1">
<a href="https://app.sandbox.trainingpeaks.com">
<a href="https://app.trainingpeaks.com">
<img src="/static/img/tpchecked.png" alt="TrainingPeaks icon" width="60" height="60"></a>
</div>
{% endif %}

View File

@@ -40,7 +40,7 @@ from rowsandall_app.settings import (
TP_REDIRECT_URI,TP_CLIENT_KEY,
)
tpapilocation = "https://api.sandbox.trainingpeaks.com"
tpapilocation = "https://api.trainingpeaks.com"
# Custom error class - to raise a NoTokenError
class TPNoTokenError(Exception):
@@ -107,7 +107,7 @@ def do_refresh_token(refreshtoken):
}
url = "https://oauth.sandbox.trainingpeaks.com/oauth/token"
url = "https://oauth.trainingpeaks.com/oauth/token"
response = requests.post(url,
data=post_data,
@@ -141,7 +141,7 @@ def get_token(code):
'Content-Type': 'application/x-www-form-urlencoded',
}
response = requests.post("https://oauth.sandbox.trainingpeaks.com/oauth/token",
response = requests.post("https://oauth.trainingpeaks.com/oauth/token",
data=post_data)
@@ -167,7 +167,7 @@ def make_authorization_url(request):
"redirect_uri": TP_REDIRECT_URI,
"scope": "file:write",
}
url = "https://oauth.sandbox.trainingpeaks.com/oauth/authorize?" +urllib.urlencode(params)
url = "https://oauth.trainingpeaks.com/oauth/authorize?" +urllib.urlencode(params)
return HttpResponseRedirect(url)

View File

@@ -1654,7 +1654,7 @@ def rower_tp_authorize(request):
"redirect_uri": TP_REDIRECT_URI,
"scope": "file:write",
}
url = "https://oauth.sandbox.trainingpeaks.com/oauth/authorize/?" +urllib.urlencode(params)
url = "https://oauth.trainingpeaks.com/oauth/authorize/?" +urllib.urlencode(params)
return HttpResponseRedirect(url)
@@ -5508,7 +5508,6 @@ def workout_getrunkeeperworkout_view(request,runkeeperid):
w = Workout.objects.get(id=id)
w.uploadedtorunkeeper=runkeeperid
thetoken = runkeeper_open(request.user)
w.runkeeperuri = runkeeperstuff.geturifromid(thetoken,runkeeperid)
w.save()
if message:
url = reverse(workout_edit_view,