Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelhly committed Oct 15, 2023
1 parent 4d830d7 commit 8525d28
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/serializers/computed_fields.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,8 @@ fn get_next_value<'a>(
input_value: &'a PyAny,
ob_type_lookup: &'a ObTypeLookup,
) -> PyResult<&'a PyAny> {
let next_value = match ob_type_lookup.get_type(input_value) {
ObType::Unknown | ObType::Dataclass => input_value.getattr(field.property_name_py.as_ref(input_value.py())),
_ => {
match ob_type_lookup.get_type(input_value) {
ObType::Dict => {
if field.has_ser_func {
Ok(input_value)
} else {
Expand All @@ -223,6 +222,6 @@ fn get_next_value<'a>(
)))
}
}
};
next_value
_ => input_value.getattr(field.property_name_py.as_ref(input_value.py())),
}
}

0 comments on commit 8525d28

Please sign in to comment.