Skip to content

Commit

Permalink
Fix fast-path
Browse files Browse the repository at this point in the history
  • Loading branch information
Pliner committed Dec 11, 2023
1 parent 4cec884 commit 81f5bfa
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions marshmallow_recipe/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,8 @@ def _deserialize(self, value: Any, attr: Any, data: Any, **kwargs: Any) -> Any:
result = super()._deserialize(value, attr, data, **kwargs)
if result.tzinfo is None:
return result.replace(tzinfo=datetime.timezone.utc)
if result.tzinfo == datetime.timezone.utc:
return result
return result.astimezone(datetime.timezone.utc)

def _serialize(self, value: Any, attr: Any, obj: Any, **kwargs: Any) -> Any:
Expand Down

0 comments on commit 81f5bfa

Please sign in to comment.