working
This commit is contained in:
@@ -1823,15 +1823,18 @@ class InstantPlan(models.Model):
|
||||
authorizationstring = 'Bearer '+settings.WORKOUTS_FIT_TOKEN
|
||||
url = settings.WORKOUTS_FIT_URL+"/trainingplan/"
|
||||
headers = {'Authorization': authorizationstring}
|
||||
response = requests.post(url=url, headers=headers, data=yamltext)
|
||||
if response.status_code == 200:
|
||||
data = response.json()
|
||||
self.yaml.name = data['filename']
|
||||
self.uuid = data['ID']
|
||||
self.name = data['name']
|
||||
self.description = data['description']
|
||||
self.duration = data['duration']
|
||||
self.yaml = None
|
||||
try:
|
||||
response = requests.post(url=url, headers=headers, data=yamltext)
|
||||
if response.status_code == 200:
|
||||
data = response.json()
|
||||
self.yaml.name = data['filename']
|
||||
self.uuid = data['ID']
|
||||
self.name = data['name']
|
||||
self.description = data['description']
|
||||
self.duration = data['duration']
|
||||
self.yaml = None
|
||||
except:
|
||||
pass
|
||||
super(InstantPlan, self).save(*args, **kwargs)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user