Add a link to the "bda-rappel" mail edition page

This commit is contained in:
Martin Pépin 2017-06-02 19:33:23 +01:00
parent 4fce1e8afc
commit 5c11893059
2 changed files with 23 additions and 3 deletions

View file

@ -23,6 +23,15 @@
</form>
{% endif %}
</div>
<hr \>
<p>
<em>Note :</em> le template de ce mail peut être modifié à
<a href="{% url 'admin:custommail_custommail_change' custommail_id %}">cette adresse</a>
</p>
<hr \>
<h3>Forme des mails</h3>
@ -35,4 +44,5 @@
{% for part in exemple_mail_2places %}
<pre>{{ part }}</pre>
{% endfor %}
{% endblock %}

View file

@ -9,6 +9,7 @@ from datetime import timedelta
from custommail.shortcuts import (
send_mass_custom_mail, send_custom_mail, render_custom_mail
)
from custommail.models import CustomMail
from django.shortcuts import render, get_object_or_404
from django.contrib.auth.decorators import login_required
from django.contrib import messages
@ -662,9 +663,18 @@ def send_rappel(request, spectacle_id):
'nb_attr': 2
})
# Contexte
ctxt = {'show': show,
'exemple_mail_1place': exemple_mail_1place,
'exemple_mail_2places': exemple_mail_2places}
custommail_id = (
CustomMail.objects
.filter(shortname="bda-rappel")
.values_list("id", flat=True)
[0]
)
ctxt = {
'show': show,
'exemple_mail_1place': exemple_mail_1place,
'exemple_mail_2places': exemple_mail_2places,
'custommail_id': custommail_id,
}
# Envoi confirmé
if request.method == 'POST':
members = show.send_rappel()