From 7137d7d4c26e7e5726098fe98caf2b5ee887234b Mon Sep 17 00:00:00 2001 From: Jirka Schaefer Date: Wed, 28 Aug 2024 09:47:54 +0200 Subject: [PATCH 1/3] fix breaking datetime str conversion --- django_walletpass/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/django_walletpass/models.py b/django_walletpass/models.py index 5571fc4..b756dd8 100644 --- a/django_walletpass/models.py +++ b/django_walletpass/models.py @@ -17,6 +17,7 @@ from django_walletpass.storage import WalletPassStorage from django_walletpass.files import WalletpassContentFile from django_walletpass.settings import dwpconfig as WALLETPASS_CONF +from dateutil.parser import parse as datetime_parse class PassBuilder: @@ -382,7 +383,7 @@ def parse_log(cls, log, message): elif 'warning' in status: status = 'warning' - log.created_at = datetime.datetime.strptime(timestamp_str, "%Y-%m-%d %H:%M:%S %p %z") + log.created_at = datetime_parse(timestamp_str) log.status = status log.task_type = task_type log.device_id = device_id From b2ddb8d6ce838ad23501d1e522a139be96e9d026 Mon Sep 17 00:00:00 2001 From: Jirka Schaefer Date: Wed, 28 Aug 2024 09:48:36 +0200 Subject: [PATCH 2/3] bump 4.2.1 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index f1b393e..7e1edf7 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ setup( name='django-walletpass', python_requires='>=3.10.0', - version='4.2', + version='4.2.1', author='Develatio Technologies S.L.', author_email='contacto@develat.io', packages=find_packages(), From 1fdb031319c80bb3d7bf25e36b904a7e9abb1903 Mon Sep 17 00:00:00 2001 From: Jirka Schaefer Date: Wed, 28 Aug 2024 10:00:49 +0200 Subject: [PATCH 3/3] pylint beauty and changelog --- CHANGELOG.md | 6 ++++++ django_walletpass/models.py | 3 +-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d0ba7c..902f61e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [4.2.1] - 2024-08-28 + +### Changed + +- stable datetime str conversion + ## [4.2] - 2024-08-26 ### Added diff --git a/django_walletpass/models.py b/django_walletpass/models.py index b756dd8..08dbb86 100644 --- a/django_walletpass/models.py +++ b/django_walletpass/models.py @@ -1,4 +1,3 @@ -import datetime import os import re import uuid @@ -8,6 +7,7 @@ import secrets import zipfile from glob import glob +from dateutil.parser import parse as datetime_parse from django.core.exceptions import ValidationError from django.utils import timezone from django.utils.module_loading import import_string @@ -17,7 +17,6 @@ from django_walletpass.storage import WalletPassStorage from django_walletpass.files import WalletpassContentFile from django_walletpass.settings import dwpconfig as WALLETPASS_CONF -from dateutil.parser import parse as datetime_parse class PassBuilder: