bg fixes
This commit is contained in:
@@ -646,8 +646,7 @@ def add_workout_race(ws,race,r):
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
wold = Workout.objects.filter(plannedsession=race,user=r)
|
ids = [w.id for w in ws]
|
||||||
ids = [w.id for w in wold] + [w.id for w in ws]
|
|
||||||
ids = list(set(ids))
|
ids = list(set(ids))
|
||||||
|
|
||||||
if len(ids)>1 and race.sessiontype in ['test','coursetest']:
|
if len(ids)>1 and race.sessiontype in ['test','coursetest']:
|
||||||
@@ -664,6 +663,7 @@ def add_workout_race(ws,race,r):
|
|||||||
comments.append('Your result has been submitted')
|
comments.append('Your result has been submitted')
|
||||||
else:
|
else:
|
||||||
errors.append('Workout %i did not match the race window' % w.id)
|
errors.append('Workout %i did not match the race window' % w.id)
|
||||||
|
return result,comments,errors
|
||||||
|
|
||||||
if result>0:
|
if result>0:
|
||||||
username = r.user.first_name+' '+r.user.last_name
|
username = r.user.first_name+' '+r.user.last_name
|
||||||
@@ -678,6 +678,7 @@ def add_workout_race(ws,race,r):
|
|||||||
) = courses.get_time_course(ws,race.course)
|
) = courses.get_time_course(ws,race.course)
|
||||||
if not coursecompleted:
|
if not coursecompleted:
|
||||||
errors.append('Your trajectory did not match the race course')
|
errors.append('Your trajectory did not match the race course')
|
||||||
|
return result,comments,errors
|
||||||
|
|
||||||
duration = totaltime_sec_to_string(coursetime)
|
duration = totaltime_sec_to_string(coursetime)
|
||||||
|
|
||||||
|
|||||||
@@ -28,10 +28,7 @@
|
|||||||
method="post">
|
method="post">
|
||||||
<div class="grid_12 alpha">
|
<div class="grid_12 alpha">
|
||||||
<div class="grid_6 alpha">
|
<div class="grid_6 alpha">
|
||||||
<p> </p>
|
<p>Select one of the following workouts that you rowed within the race window</p>
|
||||||
</div>
|
|
||||||
<div class="grid_6 omega">
|
|
||||||
<p>Workouts</p>
|
|
||||||
<table width="100%">
|
<table width="100%">
|
||||||
<tr>
|
<tr>
|
||||||
{% for field in w_form.hidden_fields %}
|
{% for field in w_form.hidden_fields %}
|
||||||
|
|||||||
@@ -11514,7 +11514,6 @@ def rower_edit_view(request,rowerid=0,message=""):
|
|||||||
r.sex = sex
|
r.sex = sex
|
||||||
r.birthdate = birthdate
|
r.birthdate = birthdate
|
||||||
if resetbounce and r.emailbounced:
|
if resetbounce and r.emailbounced:
|
||||||
print "aap"
|
|
||||||
r.emailbounced = False
|
r.emailbounced = False
|
||||||
r.save()
|
r.save()
|
||||||
form = RowerForm(instance=r)
|
form = RowerForm(instance=r)
|
||||||
@@ -13661,23 +13660,22 @@ def virtualevent_submit_result_view(request,id=0):
|
|||||||
w_form = WorkoutRaceSelectForm(workoutdata,request.POST)
|
w_form = WorkoutRaceSelectForm(workoutdata,request.POST)
|
||||||
|
|
||||||
if w_form.is_valid():
|
if w_form.is_valid():
|
||||||
selectedworkouts = [w_form.cleaned_data['workouts']]
|
selectedworkout = w_form.cleaned_data['workouts']
|
||||||
else:
|
else:
|
||||||
selectedworkouts = []
|
selectedworkout = None
|
||||||
|
|
||||||
|
|
||||||
if len(selectedworkouts) == 0:
|
|
||||||
for w in ws:
|
for w in ws:
|
||||||
remove_workout_plannedsession(w,race)
|
remove_workout_plannedsession(w,race)
|
||||||
|
|
||||||
if selectedworkouts:
|
if selectedworkout is not None:
|
||||||
workouts = Workout.objects.filter(user=r,
|
|
||||||
id__in=selectedworkouts)
|
|
||||||
|
|
||||||
for w in ws:
|
for w in ws:
|
||||||
if w.id not in selectedworkouts:
|
|
||||||
remove_workout_plannedsession(w,race)
|
remove_workout_plannedsession(w,race)
|
||||||
delete_race_result(w,race)
|
delete_race_result(w,race)
|
||||||
|
|
||||||
|
workouts = Workout.objects.filter(id=selectedworkout)
|
||||||
|
|
||||||
result,comments,errors = add_workout_race(workouts,race,r)
|
result,comments,errors = add_workout_race(workouts,race,r)
|
||||||
|
|
||||||
for c in comments:
|
for c in comments:
|
||||||
|
|||||||
Reference in New Issue
Block a user