better OTW uploading and submitting
This commit is contained in:
@@ -389,18 +389,26 @@ class UploadOptionsForm(forms.Form):
|
||||
super(UploadOptionsForm, self).__init__(*args, **kwargs)
|
||||
r = Rower.objects.get(user=self.request.user)
|
||||
races = VirtualRace.objects.filter(
|
||||
registration_closure__gt=timezone.now(),
|
||||
sessiontype='indoorrace')
|
||||
registration_closure__gt=timezone.now())
|
||||
registrations = IndoorVirtualRaceResult.objects.filter(
|
||||
race__in = races,
|
||||
userid = r.id)
|
||||
|
||||
registrations2 = VirtualRaceResult.objects.filter(
|
||||
race__in = races,
|
||||
userid = r.id,
|
||||
)
|
||||
|
||||
raceids = [r.race.id for r in registrations]
|
||||
raceids2 = [r.race.id for r in registrations2]
|
||||
|
||||
raceids = raceids+raceids2
|
||||
|
||||
races = VirtualRace.objects.filter(
|
||||
id__in=raceids
|
||||
)
|
||||
|
||||
|
||||
if races:
|
||||
self.fields['submitrace'].queryset = races
|
||||
else:
|
||||
@@ -409,6 +417,8 @@ class UploadOptionsForm(forms.Form):
|
||||
if int(raceid) in raceids:
|
||||
self.fields['submitrace'].initial = VirtualRace.objects.get(id=raceid)
|
||||
|
||||
|
||||
|
||||
# The form to indicate additional actions to be performed immediately
|
||||
# after a successful upload. This version allows the Team manager to select
|
||||
# a team member
|
||||
|
||||
Reference in New Issue
Block a user