changeset 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 017e831bbe0c
children 6a18e7ba0609
files downloads/models.py gcalendar/forms.py gcalendar/models.py membermap/models.py messages/models.py
diffstat 5 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/downloads/models.py	Tue Mar 22 20:06:21 2016 -0500
+++ b/downloads/models.py	Wed Mar 30 19:59:11 2016 -0500
@@ -77,7 +77,7 @@
         else:
             self.update_date = datetime.datetime.now()
 
-        self.html = kwargs.pop('html', None)
+        self.html = kwargs.pop('html', '')
         if not self.html and self.description:
             self.html = site_markup(self.description)
         super(DownloadBase, self).save(*args, **kwargs)
--- a/gcalendar/forms.py	Tue Mar 22 20:06:21 2016 -0500
+++ b/gcalendar/forms.py	Wed Mar 30 19:59:11 2016 -0500
@@ -125,7 +125,7 @@
 
     def clean_description(self):
         description = self.cleaned_data['description']
-        self.html = None
+        self.html = ''
         if description:
             self.html = site_markup(description, relative_urls=False)
             try:
--- a/gcalendar/models.py	Tue Mar 22 20:06:21 2016 -0500
+++ b/gcalendar/models.py	Wed Mar 30 19:59:11 2016 -0500
@@ -69,7 +69,7 @@
         ordering = ('-date_submitted', )
 
     def save(self, *args, **kwargs):
-        self.html = kwargs.pop('html', None)
+        self.html = kwargs.pop('html', '')
         if not self.html and self.description:
             self.html = site_markup(self.description, relative_urls=False)
         super(Event, self).save(*args, **kwargs)
--- a/membermap/models.py	Tue Mar 22 20:06:21 2016 -0500
+++ b/membermap/models.py	Wed Mar 30 19:59:11 2016 -0500
@@ -26,7 +26,7 @@
         verbose_name_plural = 'map entries'
 
     def save(self, *args, **kwargs):
-        self.html = kwargs.pop('html', None)
+        self.html = kwargs.pop('html', '')
         if not self.html and self.message:
             self.html = site_markup(self.message)
         self.date_updated = datetime.datetime.now()
--- a/messages/models.py	Tue Mar 22 20:06:21 2016 -0500
+++ b/messages/models.py	Wed Mar 30 19:59:11 2016 -0500
@@ -65,7 +65,7 @@
         if not self.id:
             self.send_date = datetime.datetime.now()
 
-        self.html = kwargs.pop('html', None)
+        self.html = kwargs.pop('html', '')
         if not self.html and self.message:
             self.html = site_markup(self.message)
         super(Message, self).save(*args, **kwargs)