@@ -834,7 +834,7 @@ def __init__(self, *args, **kwargs):
834834 """
835835 for field in self .fields :
836836 if field == "renewable_asset" and self .asset_type_name in RENEWABLE_ASSETS :
837- self .fields [field ]. initial = True
837+ self .initial [field ] = True
838838 self .fields [field ].widget .attrs .update ({f"df-{ field } " : "" })
839839 if field == "input_timeseries" :
840840 self .fields [field ].required = self .is_input_timeseries_empty ()
@@ -1130,15 +1130,15 @@ def __init__(self, *args, **kwargs):
11301130 asset_type_name = kwargs .pop ("asset_type" , None )
11311131 super (StorageForm , self ).__init__ (* args , asset_type = "capacity" , ** kwargs )
11321132 self .fields ["dispatchable" ].widget = forms .HiddenInput ()
1133- self .fields ["dispatchable" ]. initial = True
1133+ self .initial ["dispatchable" ] = True
11341134
11351135 if asset_type_name != "hess" :
11361136 self .fields ["fixed_thermal_losses_relative" ].widget = forms .HiddenInput ()
1137- self .fields ["fixed_thermal_losses_relative" ]. initial = 0
1137+ self .initial ["fixed_thermal_losses_relative" ] = 0
11381138 self .fields ["fixed_thermal_losses_absolute" ].widget = forms .HiddenInput ()
1139- self .fields ["fixed_thermal_losses_absolute" ]. initial = 0
1139+ self .initial ["fixed_thermal_losses_absolute" ] = 0
11401140 self .fields ["thermal_loss_rate" ].widget = forms .HiddenInput ()
1141- self .fields ["thermal_loss_rate" ]. initial = 0
1141+ self .initial ["thermal_loss_rate" ] = 0
11421142 else :
11431143 field_name = "fixed_thermal_losses_relative"
11441144 help_text = self .fields [field_name ].help_text
0 commit comments