From: Guillaume Pellerin Date: Fri, 13 Jul 2018 11:01:55 +0000 (+0200) Subject: fix period X-Git-Tag: 1.3.1~14^2 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=bf67d47ecbdf123568bfc4a1c5de960e9a266301;p=teleforma.git fix period --- diff --git a/teleforma/management/commands/teleforma-export-wifi-accounts.py b/teleforma/management/commands/teleforma-export-wifi-accounts.py index fc839ddf..f8a40f32 100644 --- a/teleforma/management/commands/teleforma-export-wifi-accounts.py +++ b/teleforma/management/commands/teleforma-export-wifi-accounts.py @@ -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()