]> git.parisson.com Git - teleforma.git/commitdiff
fix prof import, add prof to pass init
authoryomguy <yomguy@parisson.com>
Fri, 13 Jul 2012 15:17:11 +0000 (17:17 +0200)
committeryomguy <yomguy@parisson.com>
Fri, 13 Jul 2012 15:17:11 +0000 (17:17 +0200)
teleforma/management/commands/teleforma-export-professors.py
teleforma/management/commands/teleforma-reset-all-passwords-with-mail.py

index 88bddea526b35e5ed83335f23b028e5f580fd9e9..8ae5f4224445c34e8d44f2a7b79287dd008d2701 100644 (file)
@@ -20,7 +20,7 @@ class Command(BaseCommand):
         for professor in professors:
             user = professor.user
             courses = [course.code for course in professor.courses.all()]
-            list.append({'username': 'aa'+user.username,
+            list.append({'username': user.username,
                          'first_name': user.first_name,
                          'last_name': user.last_name,
                          'email': user.email,
index 897a45027ccff4fd4484433b46b7d48e9da6adf5..c50286b24002707d512145581ee5082b5b625b36 100644 (file)
@@ -36,7 +36,8 @@ class Command(BaseCommand):
         for user in users:
             profile, c = Profile.objects.get_or_create(user=user)
             student = user.student.all()
-            if profile and student and user.is_active:
+            student = user.professor.all()
+            if profile and ( student or professor ) and user.is_active:
                 if not profile.init_password and user.email:
                     self.init_password_email(user)
                     profile.init_password = True