--- /dev/null
+{% load i18n %}{% load telemeta_utils %}{% load teleforma_tags %}{% autoescape off %}Bonjour,
+
+Votre copie soumise le {{ script.date_created }} en {{ script.course }} pour la séance {{ script.session }} a été rejetée par erreur.
+
+Merci de re-soumettre votre copie dès que possible. L'ancienne sera effacée.
+
+Veuillez accepter toutes nos excuses pour ce problème technique.
+
+{% trans "Best regards" %},
+{% trans "The site administrator" %} {% trans "of the" %} {% organization %}
+
+
+{% blocktrans %}Note: This message is issued by an automated system.
+Do not reply, this would not be taken into account.{% endblocktrans %}{% endautoescape %}
--- /dev/null
+
+from optparse import make_option
+from django.conf import settings
+from django.core.management.base import BaseCommand, CommandError
+from django.contrib.auth.models import User
+from django.template.defaultfilters import slugify
+from telemeta.models import *
+from telemeta.util.unaccent import unaccent
+from teleforma.exam.models import *
+import logging
+import codecs
+import time, os
+
+
+class Command(BaseCommand):
+ help = "Send a message"
+
+ def handle(self, *args, **options):
+ sender = User.objects.get(id=0)
+ site = Site.objects.all()[0]
+ subject = 'Erreur dans la transmission de votre copie'
+ scripts = Script.objects.filter(file='scripts/2014/07/22/home')
+ print scripts.count()
+
+ for script in scripts:
+ context = {'script': self, 'site': site}
+ text = render_to_string('exam/messages/script_fix.txt', context)
+ print text
+ mess = Message(sender=sender, recipient=script.author, subject=subject[:119], body=text)
+ mess.moderation_status = 'a'
+ #mess.save()
+ #notify_user(mess, 'acceptance', site)
+