Skip to content

Commit

Permalink
Fix date to str converison (#118)
Browse files Browse the repository at this point in the history
Co-authored-by: tb1337 <[email protected]>
  • Loading branch information
tb1337 and tb1337 authored Mar 6, 2024
1 parent f1eaf0b commit 9cc86a7
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions pypaperless/models/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 9cc86a7

Please sign in to comment.