From 0e5a9f5528efca99d39545c2e6b0952955866aa5 Mon Sep 17 00:00:00 2001 From: yomguy Date: Fri, 13 Jul 2012 17:17:11 +0200 Subject: [PATCH] fix prof import, add prof to pass init --- teleforma/management/commands/teleforma-export-professors.py | 2 +- .../commands/teleforma-reset-all-passwords-with-mail.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) 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 -- 2.39.5