From 9cc86a771355343ba910e704e70ef6df0a496eed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=ED=86=A0=EB=B9=84?= Date: Wed, 6 Mar 2024 07:25:57 +0100 Subject: [PATCH] Fix date to str converison (#118) Co-authored-by: tb1337 --- pypaperless/models/utils/__init__.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pypaperless/models/utils/__init__.py b/pypaperless/models/utils/__init__.py index ee7c756..dfd240e 100644 --- a/pypaperless/models/utils/__init__.py +++ b/pypaperless/models/utils/__init__.py @@ -40,10 +40,7 @@ def _str_to_date(datestr: str): def _dateobj_to_str(value: date | datetime): """Parse string from date objects.""" - result = value.isoformat().replace("+00:00", "Z") - if isinstance(value, datetime): - result = result.rstrip("Z") + "Z" - return result + return value.isoformat().replace("+00:00", "Z") def object_to_dict_value(value: Any) -> Any: