tested functionality on test site
This commit is contained in:
@@ -84,13 +84,13 @@ def processattachment(rower, fileobj, title, uploadoptions,testing=False):
|
|||||||
make_new_workout_from_email(therower, filename, title,testing=testing)
|
make_new_workout_from_email(therower, filename, title,testing=testing)
|
||||||
]
|
]
|
||||||
|
|
||||||
if testing and workoutid[0]:
|
|
||||||
w = Workout.objects.get(id = workoutid[0])
|
|
||||||
w.startdatetime = timezone.now()
|
|
||||||
w.date = timezone.now().date()
|
|
||||||
w.save()
|
|
||||||
|
|
||||||
if 'raceid' in uploadoptions and workoutid[0]:
|
if 'raceid' in uploadoptions and workoutid[0] and rower.user.is_staff:
|
||||||
|
if testing and workoutid[0]:
|
||||||
|
w = Workout.objects.get(id = workoutid[0])
|
||||||
|
w.startdatetime = timezone.now()
|
||||||
|
w.date = timezone.now().date()
|
||||||
|
w.save()
|
||||||
try:
|
try:
|
||||||
race = VirtualRace.objects.get(id=uploadoptions['raceid'])
|
race = VirtualRace.objects.get(id=uploadoptions['raceid'])
|
||||||
if race.manager == rower.user:
|
if race.manager == rower.user:
|
||||||
|
|||||||
@@ -36,6 +36,9 @@ import courses
|
|||||||
import iso8601
|
import iso8601
|
||||||
from iso8601 import ParseError
|
from iso8601 import ParseError
|
||||||
from rowers.tasks import handle_check_race_course
|
from rowers.tasks import handle_check_race_course
|
||||||
|
from rowers.tasks import (
|
||||||
|
handle_sendemail_raceregistration,handle_sendemail_racesubmission
|
||||||
|
)
|
||||||
from rowers.utils import totaltime_sec_to_string
|
from rowers.utils import totaltime_sec_to_string
|
||||||
|
|
||||||
def get_indoorraces(workout):
|
def get_indoorraces(workout):
|
||||||
@@ -891,6 +894,7 @@ def email_submit_race(r,race,workoutid):
|
|||||||
w.duration = totaltime_sec_to_string(60.*race.sessionvalue)
|
w.duration = totaltime_sec_to_string(60.*race.sessionvalue)
|
||||||
w.save()
|
w.save()
|
||||||
|
|
||||||
|
|
||||||
elif race.sessionmode == 'distance':
|
elif race.sessionmode == 'distance':
|
||||||
delta = w.distance - race.sessionvalue
|
delta = w.distance - race.sessionvalue
|
||||||
|
|
||||||
@@ -938,6 +942,7 @@ def email_submit_race(r,race,workoutid):
|
|||||||
otherrecords = IndoorVirtualRaceResult.objects.filter(
|
otherrecords = IndoorVirtualRaceResult.objects.filter(
|
||||||
race = race).exclude(userid = r.id)
|
race = race).exclude(userid = r.id)
|
||||||
|
|
||||||
|
|
||||||
for otherrecord in otherrecords:
|
for otherrecord in otherrecords:
|
||||||
otheruser = Rower.objects.get(id=otherrecord.userid)
|
otheruser = Rower.objects.get(id=otherrecord.userid)
|
||||||
othername = otheruser.user.first_name+' '+otheruser.user.last_name
|
othername = otheruser.user.first_name+' '+otheruser.user.last_name
|
||||||
@@ -960,7 +965,6 @@ def email_submit_race(r,race,workoutid):
|
|||||||
)
|
)
|
||||||
|
|
||||||
if not records:
|
if not records:
|
||||||
print 'jet'
|
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
record = records[0]
|
record = records[0]
|
||||||
@@ -971,7 +975,7 @@ def email_submit_race(r,race,workoutid):
|
|||||||
workouts,race,r,recordid=record.id
|
workouts,race,r,recordid=record.id
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
if result:
|
if result:
|
||||||
otherrecords = IndoorVirtualRaceResult.objects.filter(
|
otherrecords = IndoorVirtualRaceResult.objects.filter(
|
||||||
race = race).exclude(userid = r.id)
|
race = race).exclude(userid = r.id)
|
||||||
|
|||||||
BIN
rowers/tests/testdata/testdata.csv.gz
vendored
BIN
rowers/tests/testdata/testdata.csv.gz
vendored
Binary file not shown.
2
rowers/tests/testdata/testdata.tcx
vendored
2
rowers/tests/testdata/testdata.tcx
vendored
@@ -2502,7 +2502,7 @@
|
|||||||
</Trackpoint>
|
</Trackpoint>
|
||||||
</Track>
|
</Track>
|
||||||
</Lap>
|
</Lap>
|
||||||
<Notes><Element 'Notes' at 0x15bdb668></Notes>
|
<Notes><Element 'Notes' at 0x153817f0></Notes>
|
||||||
</Activity>
|
</Activity>
|
||||||
</Activities>
|
</Activities>
|
||||||
<Creator>
|
<Creator>
|
||||||
|
|||||||
Reference in New Issue
Block a user