mirror of https://gitlab.com/bashrc2/epicyon
Remove any fraction from published time when checking recency
parent
9c419c2550
commit
05197552cb
2
inbox.py
2
inbox.py
|
@ -2505,6 +2505,8 @@ def _valid_post_content(base_dir: str, nickname: str, domain: str,
|
||||||
if 'T' not in published:
|
if 'T' not in published:
|
||||||
return False
|
return False
|
||||||
if 'Z' not in published:
|
if 'Z' not in published:
|
||||||
|
print('REJECT inbox post does not use Zulu time format. ' +
|
||||||
|
published)
|
||||||
return False
|
return False
|
||||||
if '.' in published:
|
if '.' in published:
|
||||||
# converts 2022-03-30T17:37:58.734Z into 2022-03-30T17:37:58Z
|
# converts 2022-03-30T17:37:58.734Z into 2022-03-30T17:37:58Z
|
||||||
|
|
2
utils.py
2
utils.py
|
@ -2753,6 +2753,8 @@ def is_recent_post(post_json_object: {}, max_days: int) -> bool:
|
||||||
recently = days_since_epoch - max_days
|
recently = days_since_epoch - max_days
|
||||||
|
|
||||||
published_date_str = post_json_object['object']['published']
|
published_date_str = post_json_object['object']['published']
|
||||||
|
if '.' in published_date_str:
|
||||||
|
published_date_str = published_date_str.split('.')[0] + 'Z'
|
||||||
try:
|
try:
|
||||||
published_date = \
|
published_date = \
|
||||||
datetime.datetime.strptime(published_date_str,
|
datetime.datetime.strptime(published_date_str,
|
||||||
|
|
Loading…
Reference in New Issue