Mercurial > public > sg101
comparison messages/models.py @ 1064:f0ac48aa8c64
Fix bug where None could be saved as html field.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Wed, 30 Mar 2016 19:59:11 -0500 |
parents | 82f1f6f905eb |
children |
comparison
equal
deleted
inserted
replaced
1063:017e831bbe0c | 1064:f0ac48aa8c64 |
---|---|
63 | 63 |
64 def save(self, *args, **kwargs): | 64 def save(self, *args, **kwargs): |
65 if not self.id: | 65 if not self.id: |
66 self.send_date = datetime.datetime.now() | 66 self.send_date = datetime.datetime.now() |
67 | 67 |
68 self.html = kwargs.pop('html', None) | 68 self.html = kwargs.pop('html', '') |
69 if not self.html and self.message: | 69 if not self.html and self.message: |
70 self.html = site_markup(self.message) | 70 self.html = site_markup(self.message) |
71 super(Message, self).save(*args, **kwargs) | 71 super(Message, self).save(*args, **kwargs) |
72 | 72 |
73 def __unicode__(self): | 73 def __unicode__(self): |