From: Guillaume Pellerin Date: Wed, 16 Jul 2014 14:24:03 +0000 (+0200) Subject: fix profile X-Git-Tag: 1.1~424 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=f86d85f142b3e566b38706de0e4d1a9b4b425f1e;p=teleforma.git fix profile --- diff --git a/teleforma/management/commands/teleforma-export-wifi-accounts.py b/teleforma/management/commands/teleforma-export-wifi-accounts.py index 6d1ce16f..70d503b0 100644 --- a/teleforma/management/commands/teleforma-export-wifi-accounts.py +++ b/teleforma/management/commands/teleforma-export-wifi-accounts.py @@ -15,11 +15,12 @@ class Command(BaseCommand): args = 'path' def handle(self, *args, **options): - path = args[0] - f = open(path, 'w') + path = args[0] + f = open(path, 'w') - for user in User.objects.all(): - profile = user.profile.get() - f.write(profile.wifi_login + ',' + profile.wifi_pass + '\n') + for user in User.objects.all(): + profile = user.profile.get() + if profile: + f.write(profile.wifi_login + ',' + profile.wifi_pass + '\n') - f.close() + f.close()