intervals auto im & export
This commit is contained in:
@@ -24,7 +24,8 @@ class Command(BaseCommand):
|
||||
record.sporttracksid = w.uploadedtosporttracks
|
||||
if w.uploadedtoc2:
|
||||
record.c2id = w.uploadedtoc2
|
||||
|
||||
if w.uploadedtointervals:
|
||||
record.intervalsid = w.uploadedtointervals
|
||||
try:
|
||||
record.save()
|
||||
except IntegrityError:
|
||||
@@ -52,7 +53,8 @@ class Command(BaseCommand):
|
||||
record.sporttracksid = w.uploadedtosporttracks
|
||||
if w.uploadedtoc2:
|
||||
record.c2id = w.uploadedtoc2
|
||||
|
||||
if w.uploadedtointervals:
|
||||
record.intervalsid = w.uploadedtointervals
|
||||
try:
|
||||
record.save()
|
||||
except IntegrityError:
|
||||
|
||||
@@ -117,5 +117,16 @@ class Command(BaseCommand):
|
||||
lines = traceback.format_exception(exc_type, exc_value, exc_traceback)
|
||||
dologging('processemail.log', ''.join('!! ' + line for line in lines))
|
||||
|
||||
rowers = Rower.objects.filter(intervals_auto_import=True)
|
||||
for r in rowers:
|
||||
try:
|
||||
if user_is_not_basic(r.user) or user_is_coachee(r.user):
|
||||
intervals_integration = IntervalsIntegration(r.user)
|
||||
_ = intervals_integration.get_workouts()
|
||||
except:
|
||||
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'))
|
||||
|
||||
Reference in New Issue
Block a user