* Fixed issue #29, thank you to Jason Nolen for reporting it. Prior

versions of Python used a different name for base64 functions, so 
  a wrapper has been added to lib.py to enable both old- and new-
  style functions to be used.
This commit is contained in:
Ross Poulton
2008-11-18 00:14:36 +00:00
parent 3361e08458
commit 77f3e71bd9
3 changed files with 21 additions and 8 deletions

9
lib.py
View File

@ -8,6 +8,14 @@ lib.py - Common functions (eg multipart e-mail)
chart_colours = ('80C65A', '990066', 'FF9900', '3399CC', 'BBCCED', '3399CC', 'FFCC33')
try:
from base64 import urlsafe_b64encode as b64encode
except ImportError:
from base64 import encodestring as b64encode
try:
from base64 import urlsafe_b64decode as b64decode
except ImportError:
from base64 import decodestring as b64decode
def send_templated_mail(template_name, email_context, recipients, sender=None, bcc=None, fail_silently=False, files=None):
"""
@ -327,3 +335,4 @@ def safe_template_context(ticket):
context['ticket']['assigned_to'] = context['ticket']['_get_assigned_to']
return context