From f86d85f142b3e566b38706de0e4d1a9b4b425f1e Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Wed, 16 Jul 2014 16:24:03 +0200 Subject: [PATCH] fix profile --- .../commands/teleforma-export-wifi-accounts.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) 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() -- 2.39.5