feat: improve user admin (#2777)

This commit is contained in:
Vlad Stan
2024-11-19 10:33:57 +02:00
committed by GitHub
parent 8c5c455f1c
commit af568d0f31
22 changed files with 1167 additions and 655 deletions
+3 -1
View File
@@ -647,7 +647,7 @@ def dict_to_model(_row: dict, model: type[TModel]) -> TModel:
if value is None:
continue
if key not in model.__fields__:
logger.warning(f"Converting {key} to model `{model}`.")
# Somethimes an SQL JOIN will create additional column
continue
type_ = model.__fields__[key].type_
outertype_ = model.__fields__[key].outer_type_
@@ -678,4 +678,6 @@ def dict_to_model(_row: dict, model: type[TModel]) -> TModel:
_dict[key] = value
continue
_model = model.construct(**_dict)
if isinstance(_model, BaseModel):
_model.__init__(**_dict) # type: ignore
return _model