Update redirection after intensity add
This commit is contained in:
parent
d08291712e
commit
f1a69276bf
|
@ -558,20 +558,23 @@ def note_create_or_update(request, note_id=None, gymnast_id=None):
|
|||
url = request.build_absolute_uri(
|
||||
reverse("gymnast_details_tab", args=(new_note.gymnast.id, "event"))
|
||||
)
|
||||
# content = (form.cleaned_data["informations"])
|
||||
receivers = [
|
||||
new_note.gymnast.user.email,
|
||||
new_note.gymnast.email_trainer,
|
||||
]
|
||||
title = f"{new_note.gymnast} : Nouvelle note"
|
||||
body = f"""<p>Bonjour,</p><p>Une nouvelle note vous a été envoyée. Vous pouvez la consulter en cliquant <a href='{url}'>ici</a>.</p>"""
|
||||
|
||||
send_mail(
|
||||
"Nouvelle note",
|
||||
title,
|
||||
"Une nouvelle note vous a été envoyée",
|
||||
settings.EMAIL_HOST_USER,
|
||||
[new_note.gymnast.user.email, new_note.gymnast.email_trainer],
|
||||
receivers,
|
||||
fail_silently=False,
|
||||
html_message=f"""<p>Bonjour,</p>
|
||||
<p>Une nouvelle note vous a été envoyée. Vous pouvez la consulter en cliquant <a href='{url}'>ici</a>.</p>
|
||||
{MAIL_FOOTER}""",
|
||||
html_message=body + MAIL_FOOTER,
|
||||
)
|
||||
return HttpResponseRedirect(
|
||||
reverse("gymnast_details_tab", args=(new_note.gymnast.id, "event"))
|
||||
reverse("intensity_details", args=(new_note.id))
|
||||
)
|
||||
|
||||
return render(request, "notes/create.html", {"form": form})
|
||||
|
|
Loading…
Reference in New Issue