fixing auto import for coachees
This commit is contained in:
@@ -34,7 +34,7 @@ import rowers.stravastuff as stravastuff
|
||||
import rowers.nkstuff as nkstuff
|
||||
from rowers.opaque import encoder
|
||||
|
||||
from rowers.rower_rules import user_is_not_basic
|
||||
from rowers.rower_rules import user_is_not_basic, user_is_coachee
|
||||
from rowers.utils import dologging
|
||||
|
||||
# If you find a solution that does not need the two paths, please comment!
|
||||
@@ -90,7 +90,7 @@ class Command(BaseCommand):
|
||||
try:
|
||||
rowers = Rower.objects.filter(c2_auto_import=True)
|
||||
for r in rowers: # pragma: no cover
|
||||
if user_is_not_basic(r.user):
|
||||
if user_is_not_basic(r.user) or user_is_coachee(r.user):
|
||||
c2stuff.get_c2_workouts(r)
|
||||
except: # pragma: no cover
|
||||
exc_type, exc_value, exc_traceback = sys.exc_info()
|
||||
@@ -100,7 +100,7 @@ class Command(BaseCommand):
|
||||
try:
|
||||
rowers = Rower.objects.filter(rp3_auto_import=True)
|
||||
for r in rowers: # pragma: no cover
|
||||
if user_is_not_basic(r.user):
|
||||
if user_is_not_basic(r.user) or user_is_coachee(r.user):
|
||||
_ = rp3stuff.get_rp3_workouts(r)
|
||||
except: # pragma: no cover
|
||||
exc_type, exc_value, exc_traceback = sys.exc_info()
|
||||
@@ -111,7 +111,7 @@ class Command(BaseCommand):
|
||||
rowers = Rower.objects.filter(nk_auto_import=True)
|
||||
for r in rowers: # pragma: no cover
|
||||
dologging("nklog.log","NK Auto import set for rower {id}".format(id=r.user.id))
|
||||
if user_is_not_basic(r.user):
|
||||
if user_is_not_basic(r.user) or user_is_coachee(r.user):
|
||||
dologging("nklog.log","User is not basic")
|
||||
_ = nkstuff.get_nk_workouts(r)
|
||||
except: # pragma: no cover
|
||||
|
||||
Reference in New Issue
Block a user