filter user when exporting

This commit is contained in:
Анатолий Богомолов 2024-03-13 18:13:08 +10:00
parent 663e73da92
commit d20062dd74
1 changed files with 1 additions and 1 deletions

View File

@ -62,6 +62,6 @@ def export_users_to_csv(id: int):
writer = csv.DictWriter(si, fieldnames)
writer.writeheader()
writer.writerows(map(lambda user: user.to_dict(), collection.users))
writer.writerows(map(lambda user: user.to_dict(), filter(lambda user: not user.delete, collection.users)))
return si.getvalue(), 200, {'Content-Disposition': f'attachment; filename={filename}', 'Content-type': 'text/csv; charset=utf-8'}