]> git.parisson.com Git - teleforma.git/commitdiff
fix profile
authorGuillaume Pellerin <yomguy@parisson.com>
Wed, 16 Jul 2014 14:35:19 +0000 (16:35 +0200)
committerGuillaume Pellerin <yomguy@parisson.com>
Wed, 16 Jul 2014 14:35:19 +0000 (16:35 +0200)
teleforma/management/commands/teleforma-export-wifi-accounts.py

index 70d503b0a4bb92783ab5589652d010d710f6313a..78cf43f01d9fe19c78afbf5edf2d7893c5c18860 100644 (file)
@@ -19,8 +19,9 @@ class Command(BaseCommand):
         f = open(path, 'w')
 
         for user in User.objects.all():
-            profile = user.profile.get()
+            profile = Profile.objects.filter(user=user)
             if profile:
-               f.write(profile.wifi_login + ',' + profile.wifi_pass + '\n')
+               p = profile[0]
+                f.write(p.wifi_login + ',' + p.wifi_pass + '\n')
 
         f.close()