updated scraoper
This commit is contained in:
@@ -14,6 +14,6 @@ importsources = {
|
||||
'nk': NKIntegration,
|
||||
'tp':TPIntegration,
|
||||
'rp3':RP3Integration,
|
||||
'polar': PolarIntegration
|
||||
'polar': PolarIntegration,
|
||||
}
|
||||
|
||||
|
||||
@@ -269,7 +269,7 @@ class NKIntegration(SyncIntegration):
|
||||
|
||||
def open(self, *args, **kwargs) -> str:
|
||||
r = self.rower
|
||||
if (r.nktoken == '') or (r.nktoken is None): # pragma: no cover
|
||||
if not r.nktoken: # pragma: no cover
|
||||
raise NoTokenError("User has no token")
|
||||
else:
|
||||
if (timezone.now() > r.nktokenexpirydate):
|
||||
|
||||
BIN
rowers/tests/testdata/testdata.tcx.gz
vendored
BIN
rowers/tests/testdata/testdata.tcx.gz
vendored
Binary file not shown.
@@ -361,7 +361,12 @@ def workout_import_view(request, source='c2'):
|
||||
enddate = enddate.date()
|
||||
|
||||
r = getrequestrower(request)
|
||||
integration = importsources[source](request.user)
|
||||
try:
|
||||
integration = importsources[source](request.user)
|
||||
except KeyError:
|
||||
messages.error(request,"This integration is not supported")
|
||||
url = reverse('workouts_view')
|
||||
return HttpResponseRedirect(url)
|
||||
|
||||
try:
|
||||
_ = integration.open()
|
||||
|
||||
Reference in New Issue
Block a user