forked from extern/django-helpdesk
more fixes on templated mail and safe context
This commit is contained in:
parent
08efeb1fc9
commit
ab84017dd5
@ -13,12 +13,12 @@ import getopt
|
||||
from optparse import make_option
|
||||
import sys
|
||||
|
||||
from django.core.management.base import BaseCommand
|
||||
from django.core.management.base import BaseCommand, CommandError
|
||||
from django.db.models import Q
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
from helpdesk.models import Queue, Ticket, FollowUp, EscalationExclusion, TicketChange
|
||||
from helpdesk.lib import send_templated_mail
|
||||
from helpdesk.lib import send_templated_mail, safe_template_context
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
@ -99,10 +99,7 @@ def escalate_tickets(queues, verbose):
|
||||
t.priority -= 1
|
||||
t.save()
|
||||
|
||||
context = {
|
||||
'ticket': t,
|
||||
'queue': q,
|
||||
}
|
||||
context = safe_template_context(t)
|
||||
|
||||
if t.submitter_email:
|
||||
send_templated_mail(
|
||||
|
@ -26,7 +26,7 @@ from django.core.management.base import BaseCommand
|
||||
from django.db.models import Q
|
||||
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 Queue, Ticket, FollowUp, Attachment, IgnoreEmail
|
||||
|
||||
|
||||
@ -246,10 +246,7 @@ def ticket_from_message(message, queue, quiet):
|
||||
t.status = Ticket.REOPENED_STATUS
|
||||
t.save()
|
||||
|
||||
context = {
|
||||
'ticket': t,
|
||||
'queue': queue,
|
||||
}
|
||||
context = safe_template_context(t)
|
||||
|
||||
if new:
|
||||
|
||||
|
@ -22,7 +22,7 @@ from django.template import loader, Context
|
||||
from django.utils import simplejson
|
||||
|
||||
from helpdesk.forms import TicketForm
|
||||
from helpdesk.lib import send_templated_mail
|
||||
from helpdesk.lib import send_templated_mail, safe_template_context
|
||||
from helpdesk.models import Ticket, Queue, FollowUp
|
||||
|
||||
STATUS_OK = 200
|
||||
@ -191,11 +191,8 @@ class API:
|
||||
|
||||
f.save()
|
||||
|
||||
context = {
|
||||
'ticket': ticket,
|
||||
'queue': ticket.queue,
|
||||
'comment': f.comment,
|
||||
}
|
||||
context = safe_template_context(ticket)
|
||||
context['comment'] = f.comment
|
||||
|
||||
messages_sent_to = []
|
||||
|
||||
@ -266,11 +263,8 @@ class API:
|
||||
)
|
||||
f.save()
|
||||
|
||||
context = {
|
||||
'ticket': ticket,
|
||||
'queue': ticket.queue,
|
||||
'resolution': f.comment,
|
||||
}
|
||||
context = safe_template_context(ticket)
|
||||
context['resolution'] = f.comment
|
||||
|
||||
subject = '%s %s (Resolved)' % (ticket.ticket, ticket.title)
|
||||
|
||||
|
@ -419,11 +419,10 @@ def mass_update(request):
|
||||
f = FollowUp(ticket=t, date=datetime.now(), title=_('Closed in bulk update'), public=True, user=request.user, new_status=Ticket.CLOSED_STATUS)
|
||||
f.save()
|
||||
# Send email to Submitter, Owner, Queue CC
|
||||
context = {
|
||||
'ticket': t,
|
||||
'queue': t.queue,
|
||||
'resolution': t.resolution,
|
||||
}
|
||||
context = safe_template_context(t)
|
||||
context.update(
|
||||
resolution=t.resolution,
|
||||
)
|
||||
|
||||
messages_sent_to = []
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user