Delay python formating of the translatable string. Fixes part of issue GL#201.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django import forms
|
||||
from django.conf import settings
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from .settings import (
|
||||
@@ -15,11 +16,16 @@ class DocumentMailForm(forms.Form):
|
||||
super(DocumentMailForm, self).__init__(*args, **kwargs)
|
||||
if as_attachment:
|
||||
self.fields['subject'].initial = setting_document_subject_template.value
|
||||
self.fields['body'].initial = setting_document_body_template.value
|
||||
self.fields['body'].initial = setting_document_body_template.value % {
|
||||
'project_title': settings.PROJECT_TITLE,
|
||||
'project_website': settings.PROJECT_WEBSITE
|
||||
}
|
||||
else:
|
||||
self.fields['subject'].initial = setting_link_subject_template.value
|
||||
self.fields['body'].initial = setting_link_body_template.value
|
||||
|
||||
self.fields['body'].initial = setting_link_body_template.value % {
|
||||
'project_title': settings.PROJECT_TITLE,
|
||||
'project_website': settings.PROJECT_WEBSITE
|
||||
}
|
||||
email = forms.EmailField(label=_('Email address'))
|
||||
subject = forms.CharField(label=_('Subject'), required=False)
|
||||
body = forms.CharField(
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.conf import settings
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
|
||||
@@ -8,16 +7,10 @@ DEFAULT_DOCUMENT_BODY_TEMPLATE = _(
|
||||
'Attached to this email is the document: {{ document }}\n\n '
|
||||
'--------\n '
|
||||
'This email has been sent from %(project_title)s (%(project_website)s)'
|
||||
) % {
|
||||
'project_title': settings.PROJECT_TITLE,
|
||||
'project_website': settings.PROJECT_WEBSITE
|
||||
}
|
||||
)
|
||||
|
||||
DEFAULT_LINK_BODY_TEMPLATE = _(
|
||||
'To access this document click on the following link: '
|
||||
'{{ link }}\n\n--------\n '
|
||||
'This email has been sent from %(project_title)s (%(project_website)s)'
|
||||
) % {
|
||||
'project_title': settings.PROJECT_TITLE,
|
||||
'project_website': settings.PROJECT_WEBSITE
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user