filter user when exporting
This commit is contained in:
parent
663e73da92
commit
d20062dd74
|
@ -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'}
|
Loading…
Reference in New Issue