]> git.openstreetmap.org Git - osqa.git/commitdiff
fix in email sender, it was aplitting the attachments, or creating multiple, don...
authorhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Wed, 14 Apr 2010 16:34:28 +0000 (16:34 +0000)
committerhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Wed, 14 Apr 2010 16:34:28 +0000 (16:34 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@33 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum/utils/mail.py

index 8dcc047bbece0b5bf85b49e476349ea52e1839db..1dc2209f81b21e87dc8ea095ca4ca9dcea9ef470 100644 (file)
@@ -88,7 +88,8 @@ def send_email(subject, recipients, template, context={}, sender=None, images=[]
     if sender is None:\r
         sender = (str(settings.APP_SHORT_NAME), str(settings.DEFAULT_FROM_EMAIL))\r
 \r
     if sender is None:\r
         sender = (str(settings.APP_SHORT_NAME), str(settings.DEFAULT_FROM_EMAIL))\r
 \r
-    images.append((os.path.join(str(settings.UPFILES_FOLDER), os.path.basename(str(settings.APP_LOGO))), 'logo'))\r
+    if not len(images):\r
+        images = [(os.path.join(str(settings.UPFILES_FOLDER), os.path.basename(str(settings.APP_LOGO))), 'logo')]\r
 \r
     context.update(application_settings(None))\r
     html_body = loader.get_template(template).render(Context(context))\r
 \r
     context.update(application_settings(None))\r
     html_body = loader.get_template(template).render(Context(context))\r