more pep
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
from rowers.models import VirtualRace, GeoCourse
|
||||
from rowers.utils import rankingdistances, rankingdurations
|
||||
from rowers.utils import (
|
||||
workflowleftpanel, workflowmiddlepanel,
|
||||
@@ -18,7 +17,7 @@ from django.contrib.auth.forms import UserCreationForm
|
||||
from django.contrib.auth.models import User
|
||||
from django.contrib.admin.widgets import AdminDateWidget
|
||||
from django.forms.widgets import SelectDateWidget, HiddenInput
|
||||
#from django.forms.extras.widgets import SelectDateWidget
|
||||
|
||||
from django.utils import timezone, translation
|
||||
from django.forms import ModelForm, Select
|
||||
import rowers.dataprep as dataprep
|
||||
@@ -573,11 +572,17 @@ class UploadOptionsForm(forms.Form):
|
||||
choices3 = [(0, '---')]
|
||||
|
||||
noregistrations = []
|
||||
for ra in VirtualRace.objects.filter(registration_closure__gt=timezone.now(), sessiontype='race'): # pragma: no cover
|
||||
for ra in VirtualRace.objects.filter(
|
||||
registration_closure__gt=timezone.now(),
|
||||
sessiontype='race'
|
||||
): # pragma: no cover
|
||||
rs = VirtualRaceResult.objects.filter(race=ra, userid=r.id)
|
||||
if rs.count() == 0:
|
||||
noregistrations.append((-ra.id, ra.name))
|
||||
for ra in VirtualRace.objects.filter(registration_closure__gt=timezone.now(), sessiontype='indoorrace'): # pragma: no cover
|
||||
for ra in VirtualRace.objects.filter(
|
||||
registration_closure__gt=timezone.now(),
|
||||
sessiontype='indoorrace'
|
||||
): # pragma: no cover
|
||||
rs = IndoorVirtualRaceResult.objects.filter(race=ra, userid=r.id)
|
||||
if rs.count() == 0:
|
||||
noregistrations.append((-ra.id, ra.name))
|
||||
@@ -1055,20 +1060,6 @@ class RegistrationFormSex(RegistrationFormUniqueEmail):
|
||||
adaptiveclass = forms.ChoiceField(label='Adaptive Classification',
|
||||
choices=adaptivecategories, initial='None', required=False)
|
||||
|
||||
# def __init__(self, *args, **kwargs):
|
||||
# self.fields['sex'].initial = 'not specified'
|
||||
|
||||
# Time field supporting microseconds. Not used, I believe.
|
||||
|
||||
|
||||
class MyTimeField(forms.TimeField):
|
||||
|
||||
def __init__(self, *args, **kwargs): # pragma: no cover
|
||||
super(MyTimeField, self).__init__(*args, **kwargs)
|
||||
supports_microseconds = True
|
||||
|
||||
# Form used to automatically define intervals by pace or power
|
||||
|
||||
|
||||
class PowerIntervalUpdateForm(forms.Form):
|
||||
selectorchoices = (
|
||||
@@ -1847,14 +1838,13 @@ class StravaChartForm(forms.Form):
|
||||
choices=yaxchoices2, label='Fourth Chart', required=True)
|
||||
|
||||
def __init__(self, request, *args, **kwargs):
|
||||
extrametrics = kwargs.pop('extrametrics', [])
|
||||
super(StravaChartForm, self).__init__(*args, **kwargs)
|
||||
|
||||
rower = Rower.objects.get(user=request.user)
|
||||
|
||||
axchoicespro = (
|
||||
('', ax[1]) if ax[4] == 'pro' and ax[0] else (ax[0], ax[1]) for ax in axes
|
||||
)
|
||||
# axchoicespro = (
|
||||
# ('', ax[1]) if ax[4] == 'pro' and ax[0] else (ax[0], ax[1]) for ax in axes
|
||||
# )
|
||||
|
||||
axchoicesbasicx = []
|
||||
axchoicesbasicy = []
|
||||
@@ -1889,14 +1879,13 @@ class FlexAxesForm(forms.Form):
|
||||
choices=yaxchoices2, label='Right Axis', required=True)
|
||||
|
||||
def __init__(self, request, *args, **kwargs):
|
||||
extrametrics = kwargs.pop('extrametrics', [])
|
||||
super(FlexAxesForm, self).__init__(*args, **kwargs)
|
||||
|
||||
rower = Rower.objects.get(user=request.user)
|
||||
|
||||
axchoicespro = (
|
||||
('', ax[1]) if ax[4] == 'pro' and ax[0] else (ax[0], ax[1]) for ax in axes
|
||||
)
|
||||
# axchoicespro = (
|
||||
# ('', ax[1]) if ax[4] == 'pro' and ax[0] else (ax[0], ax[1]) for ax in axes
|
||||
# )
|
||||
|
||||
axchoicesbasicx = []
|
||||
axchoicesbasicy = []
|
||||
|
||||
Reference in New Issue
Block a user