mirror of
https://github.com/django-helpdesk/django-helpdesk.git
synced 2025-06-20 01:27:44 +02:00
Using safe_template_context to build templated email context forms.py
Without this send_templated_mail does not work (Exception on context['queue'].get('locale', 'en')
This commit is contained in:
parent
3453de52d5
commit
23463c902e
@ -15,7 +15,7 @@ from django.conf import settings
|
|||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
from django.utils.translation import ugettext as _
|
from django.utils.translation import ugettext as _
|
||||||
|
|
||||||
from helpdesk.lib import send_templated_mail
|
from helpdesk.lib import send_templated_mail, safe_template_context
|
||||||
from helpdesk.models import Ticket, Queue, FollowUp, Attachment, IgnoreEmail, TicketCC, CustomField, TicketCustomFieldValue, TicketDependency
|
from helpdesk.models import Ticket, Queue, FollowUp, Attachment, IgnoreEmail, TicketCC, CustomField, TicketCustomFieldValue, TicketDependency
|
||||||
from helpdesk.settings import HAS_TAG_SUPPORT
|
from helpdesk.settings import HAS_TAG_SUPPORT
|
||||||
|
|
||||||
@ -280,11 +280,8 @@ class TicketForm(forms.Form):
|
|||||||
# settings.MAX_EMAIL_ATTACHMENT_SIZE) are sent via email.
|
# settings.MAX_EMAIL_ATTACHMENT_SIZE) are sent via email.
|
||||||
files.append(a.file.path)
|
files.append(a.file.path)
|
||||||
|
|
||||||
context = {
|
context = safe_template_context(t)
|
||||||
'ticket': t,
|
context['comment'] = f.comment
|
||||||
'queue': q,
|
|
||||||
'comment': f.comment,
|
|
||||||
}
|
|
||||||
|
|
||||||
messages_sent_to = []
|
messages_sent_to = []
|
||||||
|
|
||||||
@ -482,10 +479,7 @@ class PublicTicketForm(forms.Form):
|
|||||||
# settings.MAX_EMAIL_ATTACHMENT_SIZE) are sent via email.
|
# settings.MAX_EMAIL_ATTACHMENT_SIZE) are sent via email.
|
||||||
files.append(a.file.path)
|
files.append(a.file.path)
|
||||||
|
|
||||||
context = {
|
context = safe_template_context(t)
|
||||||
'ticket': t,
|
|
||||||
'queue': q,
|
|
||||||
}
|
|
||||||
|
|
||||||
messages_sent_to = []
|
messages_sent_to = []
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user