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 rowers.tasks import handle_rp3_async_workout
|
||||
@@ -100,6 +100,8 @@ class RP3Integration(SyncIntegration):
|
||||
startdatetime = kwargs.get('startdatetime', None)
|
||||
if not startdatetime:
|
||||
startdatetime = str(timezone.now())
|
||||
|
||||
record = create_or_update_syncrecord(self.rower, None, rp3id=id)
|
||||
|
||||
auth_token = self.open()
|
||||
_ = myqueue(
|
||||
@@ -172,9 +174,7 @@ class RP3Integration(SyncIntegration):
|
||||
|
||||
workouts_list = pd.json_normalize(workouts_json['data']['workouts'])
|
||||
|
||||
knownrp3ids = uniqify([
|
||||
w.uploadedtorp3 for w in Workout.objects.filter(user=r)
|
||||
])
|
||||
knownrp3ids = get_known_ids(r, 'rp3id')
|
||||
|
||||
workouts = []
|
||||
|
||||
|
||||
Reference in New Issue
Block a user