From: Guillaume Pellerin Date: Wed, 15 Jul 2015 10:44:09 +0000 (+0200) Subject: fix no profile X-Git-Tag: 1.1~208 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=abc9722b301d1c6d3a40559d4538ac4e55328011;p=teleforma.git fix no profile --- diff --git a/teleforma/management/commands/teleforma-init-wifi-pass.py b/teleforma/management/commands/teleforma-init-wifi-pass.py index 254a0b7a..1b5442de 100644 --- a/teleforma/management/commands/teleforma-init-wifi-pass.py +++ b/teleforma/management/commands/teleforma-init-wifi-pass.py @@ -24,11 +24,14 @@ class Command(BaseCommand): f = open(path, 'w') for user in User.objects.all(): - profile = user.profile.get() - if not profile.wifi_pass: - profile.wifi_login = user.username - profile.wifi_pass = id_generator(8) - profile.save() - f.write(profile.wifi_login + ',' + profile.wifi_pass + '\n') + try: + profile = user.profile.get() + if not profile.wifi_pass: + profile.wifi_login = user.username + profile.wifi_pass = id_generator(8) + profile.save() + f.write(profile.wifi_login + ',' + profile.wifi_pass + '\n') + except: + continue f.close()