Private
Public Access
1
0

SmartRow - waterrower - support

This commit is contained in:
Sander Roosendaal
2022-01-22 15:02:37 +01:00
parent a181f6f90d
commit 8d78444aae
6 changed files with 24 additions and 23 deletions

View File

@@ -443,7 +443,7 @@ def rower_process_polarcallback(request):
if user_id:
polar_user_data = polarstuff.register_user(request.user, access_token)
else:
else: # pragma: no cover
messages.error(request,'Polar Flow Authorization Failed')
url = reverse('rower_exportsettings_view')
return HttpResponseRedirect(url)
@@ -451,10 +451,10 @@ def rower_process_polarcallback(request):
try:
user_id2 = polar_user_data['polar-user-id']
except KeyError:
except KeyError: # pragma: no cover
user_id2 = 0
if user_id2 != user_id:
if user_id2 != user_id: # pragma: no cover
messages.error(request,'Polar User ID error')
#expirydatetime = timezone.now()+datetime.timedelta(seconds=expires_in)
@@ -469,7 +469,7 @@ def rower_process_polarcallback(request):
if user_id2 == user_id:
successmessage = "Tokens stored. Good to go. Please check your import/export settings"
messages.info(request,successmessage)
else:
else: # pragma: no cover
messages.error(request,"Please contact support@rowsandall.com for help.")
url = reverse('rower_exportsettings_view')
return HttpResponseRedirect(url)

View File

@@ -2576,7 +2576,7 @@ def rower_view_instantplan(request,id='',userid=0):
plan = InstantPlan.objects.get(uuid=id)
try:
discountedprice = credits.discounted(plan.price,r)
except AttributeError:
except AttributeError: # pragma: no cover
discountedprice = plan.price
authorizationstring = 'Bearer '+settings.WORKOUTS_FIT_TOKEN
@@ -2625,7 +2625,7 @@ def rower_view_instantplan(request,id='',userid=0):
return HttpResponseRedirect(url)
# check if plan is free or credits are sufficient
if plan.price > 0:
if plan.price > 0: # pragma: no cover
if plan.price > r.eurocredits:
messages.error(request,'You did not have enough credit to purchase this plan')
url = reverse('rower_view_instantplan',kwargs={
@@ -2638,7 +2638,7 @@ def rower_view_instantplan(request,id='',userid=0):
if form.is_valid():
if plan.price > 0:
if plan.price > 0: # pragma: no cover
eurocredits = credits.withdraw(plan.price,r)
plansteps = response.json()