From: yomguy Date: Fri, 13 Jul 2012 15:17:11 +0000 (+0200) Subject: fix prof import, add prof to pass init X-Git-Tag: 0.7-dev~7 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=0e5a9f5528efca99d39545c2e6b0952955866aa5;p=teleforma.git fix prof import, add prof to pass init --- diff --git a/teleforma/management/commands/teleforma-export-professors.py b/teleforma/management/commands/teleforma-export-professors.py index 88bddea5..8ae5f422 100644 --- a/teleforma/management/commands/teleforma-export-professors.py +++ b/teleforma/management/commands/teleforma-export-professors.py @@ -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, diff --git a/teleforma/management/commands/teleforma-reset-all-passwords-with-mail.py b/teleforma/management/commands/teleforma-reset-all-passwords-with-mail.py index 897a4502..c50286b2 100644 --- a/teleforma/management/commands/teleforma-reset-all-passwords-with-mail.py +++ b/teleforma/management/commands/teleforma-reset-all-passwords-with-mail.py @@ -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