Private
Public Access
1
0

more use of syncrecord

This commit is contained in:
2023-07-20 08:45:51 +02:00
parent 88c26ea713
commit 7c0558deea
7 changed files with 19 additions and 29 deletions

View File

@@ -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']))