trainingpeaks to production
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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 %}
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user