Skip to content
Snippets Groups Projects
Commit e440f555 authored by Jan Maximilian Michal's avatar Jan Maximilian Michal
Browse files

Include username in csv export

parent bafeb6da
No related branches found
No related tags found
No related merge requests found
......@@ -12,7 +12,7 @@ def export_csv(request):
response['Content-Disposition'] = 'attachment; filename="grady_results.csv"'
writer = csv.writer(response)
writer.writerow(['Matrikel', 'Name', 'Summe'] +
writer.writerow(['Matrikel', 'Username', 'Name', 'Sum'] +
[s.name for s in SubmissionType.objects.all().order_by('name')])
for student in Student.objects.all():
......@@ -22,6 +22,7 @@ def export_csv(request):
score_list = [0] * SubmissionType.objects.count()
writer.writerow([
student.matrikel_no,
student.user.username,
student.name,
sum(score_list),
*score_list
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment