Raz 9 months ago
commit d656f415b4
  1. 9
      tournaments/views.py

@ -890,10 +890,7 @@ def team_details(request, tournament_id, team_id):
class UserListExportView(LoginRequiredMixin, View): class UserListExportView(LoginRequiredMixin, View):
def get(self, request, *args, **kwargs): def get(self, request, *args, **kwargs):
# Get users, excluding those with origin=UserOrigin.SITE, ordered by date_joined users = CustomUser.objects.order_by('date_joined')
users = CustomUser.objects.exclude(
origin=UserOrigin.SITE
).order_by('date_joined')
# Prepare the response # Prepare the response
response = HttpResponse(content_type='text/plain; charset=utf-8') response = HttpResponse(content_type='text/plain; charset=utf-8')
@ -901,7 +898,7 @@ class UserListExportView(LoginRequiredMixin, View):
# Write header # Write header
headers = [ headers = [
'Prenom', 'Nom', 'Club', 'Email', 'Telephone', 'Prenom', 'Nom', 'Club', 'Email', 'Telephone',
'Login', 'Actif', 'Inscription', 'Tournois' 'origine', 'Actif', 'Inscription', 'Tournois'
] ]
response.write('\t'.join(headers) + '\n') response.write('\t'.join(headers) + '\n')
@ -913,7 +910,7 @@ class UserListExportView(LoginRequiredMixin, View):
str(user.latest_event_club_name() or ''), str(user.latest_event_club_name() or ''),
str(user.email or ''), str(user.email or ''),
str(user.phone or ''), str(user.phone or ''),
str(user.username or ''), str(user.get_origin_display()),
'Oui' if user.is_active else 'Non', 'Oui' if user.is_active else 'Non',
user.date_joined.strftime('%Y-%m-%d %H:%M:%S'), user.date_joined.strftime('%Y-%m-%d %H:%M:%S'),
str(user.event_count()) str(user.event_count())

Loading…
Cancel
Save