Merge branch 'Aufinal/fix_export' into 'master'

fix l'export des membres du COF



See merge request !51
This commit is contained in:
Martin Pepin 2016-06-27 19:17:05 +02:00
commit 7de11f2285

View file

@ -403,7 +403,7 @@ def export_members(request):
response = HttpResponse(content_type = 'text/csv')
response['Content-Disposition'] = 'attachment; filename=membres_cof.csv'
writer = unicodecsv.UnicodeWriter(response)
writer = unicodecsv.writer(response)
for profile in CofProfile.objects.filter(is_cof = True).all():
user = profile.user
bits = [profile.num, user.username, user.first_name, user.last_name, user.email, profile.phone, profile.occupation, profile.departement, profile.type_cotiz]
@ -415,7 +415,7 @@ def export_members(request):
def csv_export_mega(filename, qs):
response = HttpResponse(content_type = 'text/csv')
response['Content-Disposition'] = 'attachment; filename=' + filename
writer = unicodecsv.UnicodeWriter(response)
writer = unicodecsv.writer(response)
for reg in qs.all():
user = reg.user
@ -431,7 +431,7 @@ def export_mega_remarksonly(request):
filename = 'remarques_mega_2015.csv'
response = HttpResponse(content_type = 'text/csv')
response['Content-Disposition'] = 'attachment; filename=' + filename
writer = unicodecsv.UnicodeWriter(response)
writer = unicodecsv.writer(response)
event = Event.objects.get(title = "Mega 15")
commentfield = event.commentfields.get(name = "Commentaires")