From: Guillaume Pellerin Date: Tue, 15 Jul 2014 22:47:05 +0000 (+0200) Subject: fix tests X-Git-Tag: 1.1~429 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=1d329a8aaeea2bd73ff7e60a2e4a8b019156805c;p=teleforma.git fix tests --- diff --git a/teleforma/exam/models.py b/teleforma/exam/models.py index 616d2cbe..1a625093 100644 --- a/teleforma/exam/models.py +++ b/teleforma/exam/models.py @@ -311,7 +311,8 @@ class Script(BaseResource): def mark(self): self.date_marked = datetime.datetime.now() - context = {'script': self} + site = Site.objects.all()[0] + context = {'script': self, 'site': site} text = render_to_string('exam/messages/script_marked.txt', context) a = ugettext('Script') v = ugettext('marked') @@ -325,7 +326,8 @@ class Script(BaseResource): def reject(self): self.date_marked = datetime.datetime.now() self.date_rejected = datetime.datetime.now() - context = {'script': self} + site = Site.objects.all()[0] + context = {'script': self, 'site': site} text = render_to_string('exam/messages/script_rejected.txt', context) a = ugettext('Script') v = ugettext('rejected') @@ -333,7 +335,6 @@ class Script(BaseResource): mess = Message(sender=self.corrector, recipient=self.author, subject=subject[:119], body=text) mess.moderation_status = 'a' mess.save() - site = Site.objects.all()[0] notify_user(mess, 'acceptance', site) diff --git a/teleforma/exam/templates/exam/messages/script_marked.txt b/teleforma/exam/templates/exam/messages/script_marked.txt index 422fe15f..07502806 100644 --- a/teleforma/exam/templates/exam/messages/script_marked.txt +++ b/teleforma/exam/templates/exam/messages/script_marked.txt @@ -4,7 +4,7 @@ Votre copie soumise le {{ script.date_created }} en {{ script.course }} pour la La note, les commentaires et les annotations sont disponibles à cette adresse : -{{ site.domain }}{% url teleforma-exam-script-detail script.period.id script.id %} +http://{{ site.domain }}{% url teleforma-exam-script-detail script.period.id script.id %} {% trans "Best regards" %}, {% trans "The site administrator" %} {% trans "of the" %} {% organization %} diff --git a/teleforma/exam/templates/exam/messages/script_rejected.txt b/teleforma/exam/templates/exam/messages/script_rejected.txt index c4bb0235..a306d766 100644 --- a/teleforma/exam/templates/exam/messages/script_rejected.txt +++ b/teleforma/exam/templates/exam/messages/script_rejected.txt @@ -2,7 +2,7 @@ Votre copie soumise le {{ script.date_created }} en {{ script.course }} pour la séance {{ script.session }} a été rejetée pour le motif suivant : {% trans script.reject_reason %}. -Veuiller corriger cette erreur puis resoumettre votre copie. +Veuillez s'il vous plaît corriger cette erreur puis resoumettre votre copie. {% trans "Best regards" %}, {% trans "The site administrator" %} {% trans "of the" %} {% organization %} diff --git a/teleforma/exam/templates/exam/script_form.html b/teleforma/exam/templates/exam/script_form.html index 916243ac..8a3c467e 100644 --- a/teleforma/exam/templates/exam/script_form.html +++ b/teleforma/exam/templates/exam/script_form.html @@ -27,14 +27,18 @@ {% trans "New script" %}
-  {% trans "Blank script" %} +  {% trans "Blank script" %}
+
+ +
Merci de fournir des fichiers au format PDF uniquement et nommés sans accents ni caractères spéciaux.
{% csrf_token %} +
{% for field in form %} diff --git a/teleforma/exam/templates/exam/scripts.html b/teleforma/exam/templates/exam/scripts.html index 9d4d3fa1..8e6636bc 100644 --- a/teleforma/exam/templates/exam/scripts.html +++ b/teleforma/exam/templates/exam/scripts.html @@ -47,7 +47,10 @@ {% endif %} - {% if messages %} +{% block answers %} +
{{ title }}
+ +{% if messages %}
{% for message in messages %} {{ message }}
@@ -55,11 +58,8 @@ {% endif %} -{% block answers %} -
{{ title }}

- {% if object_list %} {% include "exam/inc/script_list.html" %} {% else %} diff --git a/teleforma/management/commands/teleforma-exam-submit-scripts.py b/teleforma/management/commands/teleforma-exam-submit-scripts.py index afc38ca5..f6b7cbd8 100644 --- a/teleforma/management/commands/teleforma-exam-submit-scripts.py +++ b/teleforma/management/commands/teleforma-exam-submit-scripts.py @@ -15,4 +15,5 @@ class Command(BaseCommand): def handle(self, *args, **options): for script in Script.objects.filter(status=2): + print unicode(script) script.submit()
{% for error in form.non_field_errors %}
  • {{ error }}
  • {% endfor %}