From 42404110157be4db4da05bfb95510f8002a9c80d Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Sat, 30 Jan 2016 09:16:50 +0100 Subject: [PATCH] fix students --- .../management/commands/teleforma-students-activate.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/teleforma/management/commands/teleforma-students-activate.py b/teleforma/management/commands/teleforma-students-activate.py index 80fb49bd..0dbe9e7e 100644 --- a/teleforma/management/commands/teleforma-students-activate.py +++ b/teleforma/management/commands/teleforma-students-activate.py @@ -37,12 +37,12 @@ class Command(BaseCommand): users = User.objects.all() for user in users: - student = user.student.all() - if student: + students = user.student.all() + if students: + student = students[0] if student.is_subscribed and not user.is_active: user.is_active = True user.save() logger.logger.info('init : ' + user.username) logger.logger.info('############## Done #################') - -- 2.39.5