doesn't try to validate if value is blank
@@ -149,7 +149,7 @@ class SimulationType(AbstractMetaDataElement):
@classmethod
def _validate_simulation_type(cls, swat_simulation_type):
types = [c[0] for c in cls.type_choices]
- if swat_simulation_type not in types:
+ if swat_simulation_type!='' and swat_simulation_type not in types:
raise ValidationError('Invalid swat_model_simulation_type:{} not in {}'.format(
swat_simulation_type, types)
)
@@ -333,6 +333,7 @@ class ModelInput(AbstractMetaDataElement):
if val == 'Choose a type':
kwargs[key] = ''
else:
+ if val != '':
if key == 'rainfallTimeStepType':
time_step = val
types = [c[0] for c in cls.rainfall_type_choices]
