Mercurial > public > sg101
comparison membermap/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 | 6164cc091649 |
children |
comparison
equal
deleted
inserted
replaced
1063:017e831bbe0c | 1064:f0ac48aa8c64 |
---|---|
24 class Meta: | 24 class Meta: |
25 ordering = ('-date_updated', ) | 25 ordering = ('-date_updated', ) |
26 verbose_name_plural = 'map entries' | 26 verbose_name_plural = 'map entries' |
27 | 27 |
28 def save(self, *args, **kwargs): | 28 def save(self, *args, **kwargs): |
29 self.html = kwargs.pop('html', None) | 29 self.html = kwargs.pop('html', '') |
30 if not self.html and self.message: | 30 if not self.html and self.message: |
31 self.html = site_markup(self.message) | 31 self.html = site_markup(self.message) |
32 self.date_updated = datetime.datetime.now() | 32 self.date_updated = datetime.datetime.now() |
33 super(MapEntry, self).save(*args, **kwargs) | 33 super(MapEntry, self).save(*args, **kwargs) |
34 | 34 |