Skip to content

Commit

Permalink
fix: show removed users in return of delete_expired_users
Browse files Browse the repository at this point in the history
  • Loading branch information
SaintShit committed Jan 2, 2024
1 parent 9da3efa commit b20c9f1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/views/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,12 @@ def delete_expired_users(bg: BackgroundTasks,
elif expired_after:
expired_users = filter(lambda u: u.expire and u.expire <= now_ts and u.expire >= expired_after_ts, dbusers)

else:
expired_users = dbusers

removed_users = []
for dbuser in expired_users:
remove_user.append(dbuser.username)
crud.remove_users(db, expired_users)

bg.add_task(
Expand All @@ -401,4 +406,4 @@ def delete_expired_users(bg: BackgroundTasks,

logger.info(f"User \"{dbuser.username}\" deleted")

return [u.username for u in expired_users]
return removed_users

0 comments on commit b20c9f1

Please sign in to comment.