Mercurial > public > sg101
comparison gcalendar/forms.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 | 68c3343f3318 |
children | 110bbc78a482 |
comparison
equal
deleted
inserted
replaced
1063:017e831bbe0c | 1064:f0ac48aa8c64 |
---|---|
123 if instance is not None: | 123 if instance is not None: |
124 del self.fields['create_forum_thread'] | 124 del self.fields['create_forum_thread'] |
125 | 125 |
126 def clean_description(self): | 126 def clean_description(self): |
127 description = self.cleaned_data['description'] | 127 description = self.cleaned_data['description'] |
128 self.html = None | 128 self.html = '' |
129 if description: | 129 if description: |
130 self.html = site_markup(description, relative_urls=False) | 130 self.html = site_markup(description, relative_urls=False) |
131 try: | 131 try: |
132 image_check(self.html) | 132 image_check(self.html) |
133 except ImageCheckError as ex: | 133 except ImageCheckError as ex: |