fix
This commit is contained in:
@@ -173,12 +173,14 @@ class PlannedSessionTests(TestCase):
|
|||||||
self.target.rowers.add(self.u.rower)
|
self.target.rowers.add(self.u.rower)
|
||||||
self.target.save()
|
self.target.save()
|
||||||
|
|
||||||
|
thismonthbegin = datetime.date(timezone.now().year,timezone.now().month,1)
|
||||||
|
|
||||||
self.plan = TrainingPlan.objects.create(
|
self.plan = TrainingPlan.objects.create(
|
||||||
manager = self.u.rower,
|
manager = self.u.rower,
|
||||||
name = faker.word(),
|
name = faker.word(),
|
||||||
status=True,
|
status=True,
|
||||||
target = self.target,
|
target = self.target,
|
||||||
startdate=timezone.now().date(),
|
startdate=thismonthbegin,
|
||||||
enddate = self.target.date,
|
enddate = self.target.date,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -213,6 +215,7 @@ class PlannedSessionTests(TestCase):
|
|||||||
plan=self.macro,
|
plan=self.macro,
|
||||||
name = '%s' % firstday.strftime("%B"),
|
name = '%s' % firstday.strftime("%B"),
|
||||||
type = 'userdefined')
|
type = 'userdefined')
|
||||||
|
|
||||||
meso.save()
|
meso.save()
|
||||||
|
|
||||||
mesos = TrainingMesoCycle.objects.filter(plan=self.macro)
|
mesos = TrainingMesoCycle.objects.filter(plan=self.macro)
|
||||||
|
|||||||
@@ -541,6 +541,7 @@ def do_sync(w,options, quick=False):
|
|||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if options['nkid'] != 0 and options['nkid'] != '': # pragma: no cover
|
if options['nkid'] != 0 and options['nkid'] != '': # pragma: no cover
|
||||||
w.uploadedtonk = options['nkid']
|
w.uploadedtonk = options['nkid']
|
||||||
@@ -620,8 +621,14 @@ def do_sync(w,options, quick=False):
|
|||||||
f.write(str(e))
|
f.write(str(e))
|
||||||
|
|
||||||
|
|
||||||
|
do_tp_export = w.user.trainingpeaks_auto_export
|
||||||
|
try:
|
||||||
|
upload_to_tp = options['upload_to_SportTracks'] or do_tp_export
|
||||||
|
do_tp_export = upload_to_tp
|
||||||
|
except KeyError:
|
||||||
|
upload_to_tp = False
|
||||||
|
|
||||||
if ('upload_to_SportTracks' in options and options['upload_to_SportTracks']) or (w.user.sporttracks_auto_export):
|
if do_tp_export:
|
||||||
try:
|
try:
|
||||||
message,id = sporttracksstuff.workout_sporttracks_upload(
|
message,id = sporttracksstuff.workout_sporttracks_upload(
|
||||||
w.user.user,w,asynchron=True,
|
w.user.user,w,asynchron=True,
|
||||||
|
|||||||
Reference in New Issue
Block a user