]> git.parisson.com Git - teleforma.git/commitdiff
fix no training
authoryomguy <yomguy@parisson.com>
Tue, 12 Jun 2012 23:51:08 +0000 (01:51 +0200)
committeryomguy <yomguy@parisson.com>
Tue, 12 Jun 2012 23:51:08 +0000 (01:51 +0200)
teleforma/management/commands/teleforma-import-users-pb.py

index 89af185e96fd367ebfd0be609621b12ec06e141c..23693343668177629d6ad90033c0c3804e4e8c9e 100644 (file)
@@ -29,9 +29,9 @@ class Command(BaseCommand):
         if 'I' in code[0:2]:
             platform_only = True
             code = code[4:]
-            training = Training.objects.get(code=code)
+            training, c = Training.objects.get_or_create(code=code)
         else:
-            training = Training.objects.get(code=code)
+            training, c = Training.objects.get_or_create(code=code)
         return platform_only, training
 
     def get_iej(self, name):