form improvement
This commit is contained in:
@@ -892,8 +892,11 @@ class RaceResultFilterForm(forms.Form):
|
|||||||
self.fields['boatclass'].choices = boatclasschoices
|
self.fields['boatclass'].choices = boatclasschoices
|
||||||
|
|
||||||
# boattype
|
# boattype
|
||||||
theboattypees = [record.boattype for record in records]
|
try:
|
||||||
theboattypees = list(set(theboattypees))
|
theboattypees = [record.boattype for record in records]
|
||||||
|
theboattypees = list(set(theboattypees))
|
||||||
|
except AttributeError:
|
||||||
|
theboattypees = []
|
||||||
|
|
||||||
if len(theboattypees)<= 1:
|
if len(theboattypees)<= 1:
|
||||||
del self.fields['boattype']
|
del self.fields['boattype']
|
||||||
|
|||||||
Reference in New Issue
Block a user