Skip to content

Commit b8cd5cb

Browse files
committed
thx to MajaW - fix for dates wo timezones
1 parent 1af41fe commit b8cd5cb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/pyff/samlmd.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import traceback
22
from copy import deepcopy
3-
from datetime import datetime, timedelta
3+
from datetime import datetime, timedelta, timezone
44
from str2bool import str2bool
55
from io import BytesIO
66
from itertools import chain
@@ -343,9 +343,9 @@ def metadata_expiration(t: ElementTree) -> Optional[timedelta]:
343343
cache_duration = config.default_cache_duration
344344
valid_until = relt.get('validUntil', None)
345345
if valid_until is not None:
346-
now = utc_now().replace(microsecond=0)
346+
now = utc_now().replace(microsecond=0).replace(tzinfo=None)
347347
vu = iso2datetime(valid_until)
348-
vu = vu.replace(microsecond=0)
348+
vu = vu.replace(microsecond=0).replace(tzinfo=None)
349349
return vu - now
350350
elif config.respect_cache_duration:
351351
cache_duration = relt.get('cacheDuration', config.default_cache_duration)

0 commit comments

Comments
 (0)