Skip to content

Commit 5965028

Browse files
committed
Adds clause to "set_fields" to address bug
1 parent 5421a7c commit 5965028

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

RATapi/classlist.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,11 @@ def set_fields(self, index: Union[int, slice, str, T], **kwargs) -> None:
318318
if isinstance(index, (str, self._class_handle)):
319319
index = self.index(index)
320320

321+
# Prioritise changing language to avoid CustomFile validator bug
322+
value = kwargs.pop("language", None)
323+
if value is not None:
324+
kwargs = {"language": value, **kwargs}
325+
321326
if importlib.util.find_spec("pydantic"):
322327
# Pydantic is installed, so set up a context manager that will
323328
# suppress custom validation errors until all fields have been set.

0 commit comments

Comments
 (0)