Permalink
Browse files

small fix for campaigns without html part.

  • Loading branch information...
1 parent ece8bca commit 5b8c49b928d0cc7430daa2a2b411a0652db42aca @arneb arneb committed Mar 30, 2009
Showing with 11 additions and 8 deletions.
  1. +8 −6 LICENSE
  2. +3 −2 campaign/models.py
View
14 LICENSE
@@ -6,14 +6,16 @@ modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
+ notice, this list of conditions and the following disclaimer.
+
* Redistributions in binary form must reproduce the above
-copyright notice, this list of conditions and the following
-disclaimer in the documentation and/or other materials provided
-with the distribution.
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+
* Neither the name of the author nor the names of other
-contributors may be used to endorse or promote products derived
-from this software without specific prior written permission.
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
View
@@ -16,8 +16,8 @@ class MailTemplate(models.Model):
"""
name = models.CharField(_(u"Name"), max_length=255)
- html = models.TextField(_(u"HTML Body"), blank=True, null=True)
plain = models.TextField(_(u"Plaintext Body"))
+ html = models.TextField(_(u"HTML Body"), blank=True, null=True)
subject = models.CharField(_(u"Subject"), max_length=255)
def __unicode__(self):
@@ -107,7 +107,8 @@ def _send(self, connection):
"""
subject = self.template.subject
text_template = template.Template(self.template.plain)
- html_template = template.Template(self.template.html)
+ if self.template.html is not None and self.template.html != u"":
+ html_template = template.Template(self.template.html)
sent = 0
for recipient_list in self.recipients.all():

0 comments on commit 5b8c49b

Please sign in to comment.