Skip to content

Commit

Permalink
fix: Emails should translate into server language
Browse files Browse the repository at this point in the history
Fixes #1589
  • Loading branch information
devkapilbansal authored and atodorov committed Mar 25, 2021
1 parent 63733c2 commit a97c1ea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tcms/core/utils/mailto.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
from django.conf import settings
from django.core.mail import send_mail
from django.template.loader import render_to_string
from django.utils.translation import override


@override(settings.LANGUAGE_CODE)
def mailto( # pylint: disable=invalid-name
template_name,
subject,
Expand Down
2 changes: 2 additions & 0 deletions tcms/kiwi_auth/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from django.contrib.sites.models import Site
from django.urls import reverse
from django.utils.translation import gettext_lazy as _
from django.utils.translation import override

from tcms.core.utils import request_host_link
from tcms.core.utils.mailto import mailto
Expand Down Expand Up @@ -56,6 +57,7 @@ def save(self, commit=True):
def set_activation_key(self):
return UserActivationKey.set_random_key_for_user(user=self.instance)

@override(settings.LANGUAGE_CODE)
def send_confirm_mail(self, request, activation_key):
current_site = Site.objects.get(pk=settings.SITE_ID)
confirm_url = "%s%s" % (
Expand Down

0 comments on commit a97c1ea

Please sign in to comment.