translation.activate(self.language_code)
for student in students:
- if student.is_subscribed and student.confirmation_sent and student.user.email and student.user.is_active:
- student.user.is_active = False
- student.user.save()
- logger.logger.info('deactivated : ' + student.user.username)
+ if hasattr(student, 'user'):
+ if student.is_subscribed and student.confirmation_sent and student.user.email and student.user.is_active:
+ student.user.is_active = False
+ student.user.save()
+ logger.logger.info('deactivated : ' + student.user.username)
logger.logger.info('############## Done #################')