Skip to content

Commit

Permalink
Merge pull request #27 from AUTGamecraft/excel
Browse files Browse the repository at this point in the history
Excel
  • Loading branch information
Javad-Ak authored Sep 19, 2024
2 parents 052f35f + 6cc6a8c commit f8f5e64
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions user/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def export_selected_users(self, request, queryset):
for user in queryset:
data.append([user.first_name, user.email, user.phone_number, user.start_date])

return ExcelResponse(data=data, worksheet_name="Users")
return ExcelResponse(data=data, worksheet_name="Users", output_filename="users")

def export_selected_services(self, request, queryset):
data = []
Expand All @@ -28,7 +28,7 @@ def export_selected_services(self, request, queryset):

data.sort(key=lambda x: x[3])
data.insert(0, headers)
return ExcelResponse(data=data, worksheet_name="Participants")
return ExcelResponse(data=data, worksheet_name="Services", output_filename="services")

def export_selected_online_participants(self, request, queryset):
data = []
Expand All @@ -46,7 +46,7 @@ def export_selected_online_participants(self, request, queryset):
if classes:
data.append([user.email, user.phone_number, user.first_name, classes[1:], "normal"])

return ExcelResponse(data=data, worksheet_name="Participants")
return ExcelResponse(data=data, worksheet_name="Participants", output_filename="participants")

actions = ['export_selected_users', 'export_selected_services', 'export_selected_online_participants']
export_selected_users.short_description = 'Export selected site users'
Expand Down

0 comments on commit f8f5e64

Please sign in to comment.