Private
Public Access
1
0

tested functionality on test site

This commit is contained in:
Sander Roosendaal
2019-01-24 21:01:05 +01:00
parent 29e097359e
commit 2ec4419597
4 changed files with 13 additions and 9 deletions

View File

@@ -84,13 +84,13 @@ def processattachment(rower, fileobj, title, uploadoptions,testing=False):
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:
race = VirtualRace.objects.get(id=uploadoptions['raceid'])
if race.manager == rower.user:

View File

@@ -36,6 +36,9 @@ import courses
import iso8601
from iso8601 import ParseError
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
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.save()
elif race.sessionmode == 'distance':
delta = w.distance - race.sessionvalue
@@ -938,6 +942,7 @@ def email_submit_race(r,race,workoutid):
otherrecords = IndoorVirtualRaceResult.objects.filter(
race = race).exclude(userid = r.id)
for otherrecord in otherrecords:
otheruser = Rower.objects.get(id=otherrecord.userid)
othername = otheruser.user.first_name+' '+otheruser.user.last_name
@@ -960,7 +965,6 @@ def email_submit_race(r,race,workoutid):
)
if not records:
print 'jet'
return 0
record = records[0]
@@ -971,7 +975,7 @@ def email_submit_race(r,race,workoutid):
workouts,race,r,recordid=record.id
)
if result:
otherrecords = IndoorVirtualRaceResult.objects.filter(
race = race).exclude(userid = r.id)

Binary file not shown.

View File

@@ -2502,7 +2502,7 @@
</Trackpoint>
</Track>
</Lap>
<Notes>&lt;Element 'Notes' at 0x15bdb668&gt;</Notes>
<Notes>&lt;Element 'Notes' at 0x153817f0&gt;</Notes>
</Activity>
</Activities>
<Creator>