To protect your data, the CISO officer has suggested users to enable 2FA as soon as possible.
Currently 2.7% of users enabled 2FA.

Commit 673227f1 authored by Liam Hayes's avatar Liam Hayes
Browse files

fixed a download form bug

parent 83a5c707
......@@ -38,7 +38,7 @@ class APIForm(Form):
turbine = forms.ModelChoiceField(
label='Wind turbine',
queryset=PowerCurve.objects.all().order_by('name'),
#initial=PowerCurve.objects.get(name='Vestas V126-3450'),
initial=PowerCurve.objects.get(name='Vestas V126-3450'),
required=False,
)
......@@ -106,4 +106,12 @@ class APIForm(Form):
height = int(value.data['height'])
if height < 0 or height > 500:
raise forms.ValidationError('Must be in range 0 to 500')
return height
\ No newline at end of file
return height
def clean_turbine(value):
if value.data.get('calculate_capacity_factors') == 'on':
turbine = value.data.get('turbine')
if turbine == '' or turbine == None:
raise forms.ValidationError('Select a turbine model')
return PowerCurve.objects.get(id=int(turbine))
return None
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment