Move the self.editable check before all the parsing and validating
@@ -662,6 +662,9 @@ def on_bind(self) -> None:
self.initial = evaluate_strict(self.initial, **self.iommi_evaluate_parameters())
self._read_initial()
+ if not self.editable:
+ self.value = self.initial
+ else:
self._read_raw_data()
self.parsed_data = evaluate_strict(self.parsed_data, **self.iommi_evaluate_parameters())
@@ -701,9 +704,6 @@ def _parse(self):
if self.parsed_data is not None:
return
- if not self.editable:
- return
-
if self.form.mode is INITIALS_FROM_GET and self.raw_data is None:
return
@@ -733,7 +733,7 @@ def _parse_raw_value(self, raw_data):
def _validate(self):
form = self.form
- if (not self.editable) or (form.mode is INITIALS_FROM_GET and (self.raw_data is None or (self.raw_data == [] and self.is_list))):
+ if form.mode is INITIALS_FROM_GET and (self.raw_data is None or (self.raw_data == [] and self.is_list)):
self.value = self.initial
return
