|
|
|
|
@ -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()) |
|
|
|
|
|