Fix mailing list retrieval
Signed-off-by: Mattia Verga <mattia.verga@tiscali.it>
This commit is contained in:
parent
5ea678fbee
commit
e2eff85e89
1 changed files with 2 additions and 2 deletions
|
|
@ -332,8 +332,8 @@ def _check_maillists_activity(fasclient, user, delta=365):
|
|||
return (False, [])
|
||||
for email in emails:
|
||||
r = session.get(f'https://lists.fedoraproject.org/archives/api/sender/{email}/emails/?ordering=-date').json()
|
||||
if r:
|
||||
last_email_date = datetime.fromisoformat(r[0]['date'].replace('Z', '+00:00'))
|
||||
if posts := r.get('results'):
|
||||
last_email_date = datetime.fromisoformat(posts[0]['date'].replace('Z', '+00:00'))
|
||||
time_delta = datetime.now(timezone.utc) - last_email_date
|
||||
if time_delta.days <= delta:
|
||||
log.info(f'Found recent email from user {user}: {last_email_date}.')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue