passing all tests on py3
This commit is contained in:
@@ -6,6 +6,8 @@ from __future__ import unicode_literals
|
||||
from __future__ import unicode_literals, absolute_import
|
||||
# All the functionality to connect to SportTracks
|
||||
|
||||
import numpy
|
||||
|
||||
from rowers.imports import *
|
||||
import re
|
||||
from rowsandall_app.settings import (
|
||||
@@ -235,6 +237,11 @@ def getidfromresponse(response):
|
||||
|
||||
return int(id)
|
||||
|
||||
def default(o):
|
||||
if isinstance(o, numpy.int64): return int(o)
|
||||
raise TypeError
|
||||
|
||||
|
||||
|
||||
def workout_sporttracks_upload(user,w):
|
||||
message = "Uploading to SportTracks"
|
||||
@@ -257,7 +264,7 @@ def workout_sporttracks_upload(user,w):
|
||||
'Content-Type': 'application/json'}
|
||||
|
||||
url = "https://api.sporttracks.mobi/api/v2/fitnessActivities.json"
|
||||
response = requests.post(url,headers=headers,data=json.dumps(data))
|
||||
response = requests.post(url,headers=headers,data=json.dumps(data,default=default))
|
||||
|
||||
# check for duplicate error first
|
||||
if (response.status_code == 409 ):
|
||||
|
||||
Reference in New Issue
Block a user