From: Guillaume Pellerin Date: Fri, 6 Dec 2013 20:40:16 +0000 (+0100) Subject: indent X-Git-Tag: 2.8.1-pro~481^2 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=87f675142cbac3f9235907cd0aab3f680e6401da;p=teleforma.git indent --- diff --git a/teleforma/management/commands/teleforma-message-all-seminar-users.py b/teleforma/management/commands/teleforma-message-all-seminar-users.py index fd1cd3b7..14ad0697 100644 --- a/teleforma/management/commands/teleforma-message-all-seminar-users.py +++ b/teleforma/management/commands/teleforma-message-all-seminar-users.py @@ -35,35 +35,34 @@ class Command(BaseCommand): auditor = user.auditor.all() if auditor and profile and user.is_active and user.email: seminars = auditor.seminars.all() - for seminar in seminars: + for seminar in seminars: + organization = seminar.course.department.name + site = Site.objects.get_current() + path = reverse('teleforma-seminar-detail', kwargs={'pk':seminar.id}) + gender = auditor[0].get_gender_display() - organization = seminar.course.department.name - site = Site.objects.get_current() - path = reverse('teleforma-seminar-detail', kwargs={'pk':seminar.id}) - gender = auditor[0].get_gender_display() + if seminar.sub_title: + title = seminar.sub_title + ' : ' + seminar.title + else: + + context['gender'] = gender + context['first_name'] = user.first_name + context['last_name'] = user.last_name + context['rank'] = answer.question.rank + context['site'] = site + context['path'] = path + context['title'] = title + context['organization'] = organization + context['date'] = seminar.expiry_date + + text = render_to_string(self.message_template, context) + subject = render_to_string(self.subject_template, context) + subject = '%s : %s' % (seminar.title, subject) - if seminar.sub_title: - title = seminar.sub_title + ' : ' + seminar.title - else: - - context['gender'] = gender - context['first_name'] = user.first_name - context['last_name'] = user.last_name - context['rank'] = answer.question.rank - context['site'] = site - context['path'] = path - context['title'] = title - context['organization'] = organization - context['date'] = seminar.expiry_date - - text = render_to_string(self.message_template, context) - subject = render_to_string(self.subject_template, context) - subject = '%s : %s' % (seminar.title, subject) - - mess = Message(sender=sender, recipient=user, subject=subject[:119], body=text) - mess.moderation_status = 'a' - #mess.save() - #notify_user(mess, 'acceptance') - - print user.username, seminar.title + mess = Message(sender=sender, recipient=user, subject=subject[:119], body=text) + mess.moderation_status = 'a' + #mess.save() + #notify_user(mess, 'acceptance') + + print user.username, seminar.title