From 74e0b4331149c834cfae35c554ba02f544553ed1 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Fri, 14 Jun 2024 20:41:28 +0200 Subject: [PATCH] fix: correct syntax for translating string when sending emails --- umap/views.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/umap/views.py b/umap/views.py index 349e66d5..7830d373 100644 --- a/umap/views.py +++ b/umap/views.py @@ -879,11 +879,10 @@ class SendEditLink(FormLessEditMixin, FormView): return HttpResponseBadRequest("Invalid") link = self.object.get_anonymous_edit_url() - subject = _( - "The uMap edit link for your map: %(map_name)s" - % {"map_name": self.object.name} - ) - body = _("Here is your secret edit link: %(link)s" % {"link": link}) + subject = _("The uMap edit link for your map: %(map_name)s") % { + "map_name": self.object.name + } + body = _("Here is your secret edit link: %(link)s") % {"link": link} try: send_mail( 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}) ) return simple_json_response( - info=_("Email sent to %(email)s" % {"email": email}) + info=_("Email sent to %(email)s") % {"email": email} )