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