Skip to content

Commit eabf806

Browse files
authored
Use tz-aware datetimes for embargo checks (#946)
Fixes regression introduced in commit 6ae3de9
1 parent 6ae3de9 commit eabf806

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pywb/warcserver/access_checker.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,11 @@ def parse_embargo(self, embargo):
115115

116116
value = embargo.get('before')
117117
if value:
118-
embargo['before'] = timestamp_to_datetime(str(value))
118+
embargo['before'] = timestamp_to_datetime(str(value), tz_aware=True)
119119

120120
value = embargo.get('after')
121121
if value:
122-
embargo['after'] = timestamp_to_datetime(str(value))
122+
embargo['after'] = timestamp_to_datetime(str(value), tz_aware=True)
123123

124124
value = embargo.get('older')
125125
if value:
@@ -147,7 +147,7 @@ def check_embargo(self, url, ts):
147147
if not self.embargo:
148148
return None
149149

150-
dt = timestamp_to_datetime(ts)
150+
dt = timestamp_to_datetime(ts, tz_aware=True)
151151
access = self.embargo.get('access', 'exclude')
152152

153153
# embargo before

0 commit comments

Comments
 (0)