From 19eb5030c68696b90b7592dfc9427f764de828a3 Mon Sep 17 00:00:00 2001 From: Laurent Date: Mon, 17 Feb 2025 12:39:21 +0100 Subject: [PATCH] user exports --- tournaments/views.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tournaments/views.py b/tournaments/views.py index 343acb8..57f621b 100644 --- a/tournaments/views.py +++ b/tournaments/views.py @@ -890,10 +890,7 @@ def team_details(request, tournament_id, team_id): class UserListExportView(LoginRequiredMixin, View): def get(self, request, *args, **kwargs): - # Get users, excluding those with origin=UserOrigin.SITE, ordered by date_joined - users = CustomUser.objects.exclude( - origin=UserOrigin.SITE - ).order_by('date_joined') + users = CustomUser.objects.order_by('date_joined') # Prepare the response response = HttpResponse(content_type='text/plain; charset=utf-8') @@ -901,7 +898,7 @@ class UserListExportView(LoginRequiredMixin, View): # Write header headers = [ 'Prenom', 'Nom', 'Club', 'Email', 'Telephone', - 'Login', 'Actif', 'Inscription', 'Tournois' + 'origine', 'Actif', 'Inscription', 'Tournois' ] response.write('\t'.join(headers) + '\n') @@ -913,7 +910,7 @@ class UserListExportView(LoginRequiredMixin, View): str(user.latest_event_club_name() or ''), str(user.email or ''), str(user.phone or ''), - str(user.username or ''), + str(user.get_origin_display()), 'Oui' if user.is_active else 'Non', user.date_joined.strftime('%Y-%m-%d %H:%M:%S'), str(user.event_count())