Mercurial > public > sg101
comparison forums/models.py @ 955:71a671dab55d
First commit of whitelisting image hosts.
This is behind a feature flag courtesy of waffle.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Wed, 03 Jun 2015 21:13:08 -0500 |
parents | 2e429e2b7bb6 |
children | 5ba2508939f7 |
comparison
equal
deleted
inserted
replaced
954:e56455f4626b | 955:71a671dab55d |
---|---|
309 def save(self, *args, **kwargs): | 309 def save(self, *args, **kwargs): |
310 if not self.id: | 310 if not self.id: |
311 self.creation_date = datetime.datetime.now() | 311 self.creation_date = datetime.datetime.now() |
312 self.update_date = self.creation_date | 312 self.update_date = self.creation_date |
313 | 313 |
314 self.html = site_markup(self.body) | 314 self.html = kwargs.pop('html', None) |
315 if self.html is None: | |
316 self.html = site_markup(self.body) | |
315 super(Post, self).save(*args, **kwargs) | 317 super(Post, self).save(*args, **kwargs) |
316 | 318 |
317 def delete(self, *args, **kwargs): | 319 def delete(self, *args, **kwargs): |
318 first_post_id = self.topic.posts.all()[0].id | 320 first_post_id = self.topic.posts.all()[0].id |
319 super(Post, self).delete(*args, **kwargs) | 321 super(Post, self).delete(*args, **kwargs) |