From: Guillaume Pellerin Date: Sat, 30 Jan 2016 08:16:50 +0000 (+0100) Subject: fix students X-Git-Tag: 1.1~166 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=42404110157be4db4da05bfb95510f8002a9c80d;p=teleforma.git fix students --- 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 #################') -