]> git.parisson.com Git - teleforma.git/commitdiff
fix csv EOL
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Tue, 13 Jun 2023 12:43:33 +0000 (14:43 +0200)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Tue, 13 Jun 2023 12:43:49 +0000 (14:43 +0200)
teleforma/management/commands/teleforma-export-wifi-accounts.py

index d4734601e406e016fd64226865e47533353b8bcb..9b246ae6a2c38d5834235f139b33c262993d1302 100644 (file)
@@ -23,7 +23,7 @@ class Command(BaseCommand):
 
         f = open(path, 'w')
         period = Period.objects.get(name=period_name)
-        s = ''
+        s+ = "prenom,nom,login,pass\n"
 
         for user in User.objects.all():
             profile = Profile.objects.filter(user=user)
@@ -40,8 +40,7 @@ class Command(BaseCommand):
                     data.append(user.last_name)
                     data.append(p.wifi_login)
                     data.append(p.wifi_pass)
-                    data.append('\n')
-                    s += ','.join(data)
+                    s += ','.join(data)+'\n'
         f.write(s)
         f.close()