Skip to content

Commit

Permalink
πŸ› fix date parsing in paperless
Browse files Browse the repository at this point in the history
aparently isoformat differs widely between python versions
  • Loading branch information
krmax44 committed Oct 25, 2024
1 parent b241d19 commit 1694a79
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fragdenstaat_de/fds_paperless/paperless.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from datetime import datetime, timedelta
from datetime import timedelta

from django.conf import ImproperlyConfigured, settings
from django.utils import timezone

import dateutil.parser
import requests


Expand Down Expand Up @@ -43,7 +44,7 @@ def list_documents():
data = client.get(API_URL).json()

def map_doc(document):
document["created"] = datetime.fromisoformat(document["created"])
document["created"] = dateutil.parser.parse(document["created"])
document["url"] = get_preview_link(document["id"])
return document

Expand Down

0 comments on commit 1694a79

Please sign in to comment.