From d20062dd74fcce89ddb4a5bd010162b7fc5611cf Mon Sep 17 00:00:00 2001 From: winet Date: Wed, 13 Mar 2024 18:13:08 +1000 Subject: [PATCH] filter user when exporting --- app/blueprints/api/collections/routes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/blueprints/api/collections/routes.py b/app/blueprints/api/collections/routes.py index d9fabe0..4c50530 100644 --- a/app/blueprints/api/collections/routes.py +++ b/app/blueprints/api/collections/routes.py @@ -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'} \ No newline at end of file