Private
Public Access
1
0

more refactorgoodies

This commit is contained in:
2023-07-18 22:24:10 +02:00
parent 250263b74c
commit 8f060ed5bb
4 changed files with 26 additions and 17 deletions

View File

@@ -1,6 +1,6 @@
from abc import ABCMeta, ABC, abstractmethod
from importlib import import_module
from rowers.models import Rower, User
from rowers.models import Rower, User, create_or_update_syncrecord
from rowers.utils import NoTokenError,dologging
import requests

View File

@@ -1,5 +1,5 @@
from .integrations import SyncIntegration, NoTokenError
from rowers.models import User, Rower, Workout, TombStone, SyncRecord
from .integrations import SyncIntegration, NoTokenError, create_or_update_syncrecord
from rowers.models import User, Rower, Workout, TombStone
from django.db.utils import IntegrityError
from rowers import mytypes
@@ -91,14 +91,7 @@ class NKIntegration(SyncIntegration):
_ = self.open()
r = self.rower
record = SyncRecord(
rower = r,
nkid = id,
)
try:
record.save()
except IntegrityError:
return 0
record = create_or_update_syncrecord(rower, None, nkid=id)
before = kwargs.get('before',0)
after = kwargs.get('after',0)