Private
Public Access
1
0

attempt to fix nk auto import

This commit is contained in:
Sander Roosendaal
2023-05-12 16:30:20 +02:00
parent e6fbd34780
commit 0d478b96c7
4 changed files with 31 additions and 26 deletions

View File

@@ -83,40 +83,39 @@ class Command(BaseCommand):
dologging('processemail.log', ''.join('!! ' + line for line in lines))
# Concept2
try:
rowers = Rower.objects.filter(c2_auto_import=True)
for r in rowers: # pragma: no cover
rowers = Rower.objects.filter(c2_auto_import=True)
for r in rowers: # pragma: no cover
try:
if user_is_not_basic(r.user) or user_is_coachee(r.user):
c2integration = C2Integration(r.user)
_ = c2integration.get_workouts()
except: # pragma: no cover
exc_type, exc_value, exc_traceback = sys.exc_info()
lines = traceback.format_exception(exc_type, exc_value, exc_traceback)
dologging('processemail.log', ''.join('!! ' + line for line in lines))
except: # pragma: no cover
exc_type, exc_value, exc_traceback = sys.exc_info()
lines = traceback.format_exception(exc_type, exc_value, exc_traceback)
dologging('processemail.log', ''.join('!! ' + line for line in lines))
try:
rowers = Rower.objects.filter(rp3_auto_import=True)
for r in rowers: # pragma: no cover
rowers = Rower.objects.filter(rp3_auto_import=True)
for r in rowers: # pragma: no cover
try:
if user_is_not_basic(r.user) or user_is_coachee(r.user):
rp3_integration = RP3Integration(r.user)
_ = rp3_integration.get_workouts()
except: # pragma: no cover
exc_type, exc_value, exc_traceback = sys.exc_info()
lines = traceback.format_exception(exc_type, exc_value, exc_traceback)
dologging('processemail.log', ''.join('!! ' + line for line in lines))
except: # pragma: no cover
exc_type, exc_value, exc_traceback = sys.exc_info()
lines = traceback.format_exception(exc_type, exc_value, exc_traceback)
dologging('processemail.log', ''.join('!! ' + line for line in lines))
try:
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))
rowers = Rower.objects.filter(nk_auto_import=True)
for r in rowers: # pragma: no cover
try:
if user_is_not_basic(r.user) or user_is_coachee(r.user):
dologging("nklog.log","NK Auto import set for rower {id}".format(id=r.user.id))
nk_integration = NKIntegration(r.user)
_ = nk_integration.get_workouts()
except: # pragma: no cover
exc_type, exc_value, exc_traceback = sys.exc_info()
lines = traceback.format_exception(exc_type, exc_value, exc_traceback)
dologging('processemail.log', ''.join('!! ' + line for line in lines))
except: # pragma: no cover
exc_type, exc_value, exc_traceback = sys.exc_info()
lines = traceback.format_exception(exc_type, exc_value, exc_traceback)
dologging('processemail.log', ''.join('!! ' + line for line in lines))
self.stdout.write(self.style.SUCCESS(
'Successfully processed email attachments'))