]> git.parisson.com Git - teleforma.git/commitdiff
fix period
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Fri, 13 Jul 2018 11:01:55 +0000 (13:01 +0200)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Fri, 13 Jul 2018 11:01:55 +0000 (13:01 +0200)
teleforma/management/commands/teleforma-export-wifi-accounts.py

index fc839ddf4f9c01ca1b69a501a9aeb35ee20bc2bd..f8a40f32706c9d8133c8d33c407ca10379a44023 100644 (file)
@@ -19,14 +19,15 @@ class Command(BaseCommand):
         period_name = args[1]
 
         f = open(path, 'w')
-
+        period = Period.objects.get(name=period_name)
+        
         for user in User.objects.all():
             profile = Profile.objects.filter(user=user)
             students = user.student.all()
             if profile and students:
                p = profile[0]
                 student = students[0]
-                if student.is_subscribed and not user.is_active and student.period == period:
+                if student.is_subscribed and user.is_active and student.period == period:
                     f.write(p.wifi_login + ',' + p.wifi_pass + '\n')
 
         f.close()