feat: improve user admin (#2777)
This commit is contained in:
+3
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user