more use of syncrecord
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from .integrations import SyncIntegration, NoTokenError
|
||||
from .integrations import SyncIntegration, NoTokenError, create_or_update_syncrecord, get_known_ids
|
||||
from rowers.models import User, Rower, Workout, TombStone
|
||||
from rowingdata import rowingdata
|
||||
|
||||
@@ -212,6 +212,8 @@ class StravaIntegration(SyncIntegration):
|
||||
except NoTokenError("Strava error"):
|
||||
return 0
|
||||
|
||||
record = create_or_update_syncrecord(self.rower, None, stravaid=id)
|
||||
|
||||
csvfilename = 'media/{code}_{id}.csv'.format(
|
||||
code=uuid4().hex[:16], id=id)
|
||||
job = myqueue(queue,
|
||||
@@ -279,9 +281,7 @@ class StravaIntegration(SyncIntegration):
|
||||
w.uploadedtostrava = int(stravaid)
|
||||
w.save()
|
||||
|
||||
knownstravaids = uniqify([
|
||||
w.uploadedtostrava for w in Workout.objects.filter(user=self.rower)
|
||||
])
|
||||
knownstravaids = get_known_ids(self.rower,'stravaid')
|
||||
|
||||
for item in res.json():
|
||||
d = int(float(item['distance']))
|
||||
|
||||
Reference in New Issue
Block a user