fix: correct syntax for translating string when sending emails

This commit is contained in:
Yohan Boniface 2024-06-14 20:41:28 +02:00
parent ca18c5b7df
commit 74e0b43311

View file

@ -879,11 +879,10 @@ class SendEditLink(FormLessEditMixin, FormView):
return HttpResponseBadRequest("Invalid") return HttpResponseBadRequest("Invalid")
link = self.object.get_anonymous_edit_url() link = self.object.get_anonymous_edit_url()
subject = _( subject = _("The uMap edit link for your map: %(map_name)s") % {
"The uMap edit link for your map: %(map_name)s" "map_name": self.object.name
% {"map_name": self.object.name} }
) body = _("Here is your secret edit link: %(link)s") % {"link": link}
body = _("Here is your secret edit link: %(link)s" % {"link": link})
try: try:
send_mail( send_mail(
subject, body, settings.DEFAULT_FROM_EMAIL, [email], fail_silently=False subject, body, settings.DEFAULT_FROM_EMAIL, [email], fail_silently=False
@ -893,7 +892,7 @@ class SendEditLink(FormLessEditMixin, FormView):
error=_("Can't send email to %(email)s" % {"email": email}) error=_("Can't send email to %(email)s" % {"email": email})
) )
return simple_json_response( return simple_json_response(
info=_("Email sent to %(email)s" % {"email": email}) info=_("Email sent to %(email)s") % {"email": email}
) )