Mercurial > public > sg101
comparison forums/models.py @ 963:4619290d171d
Whitelist hot-linked image sources.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Tue, 01 Sep 2015 20:33:40 -0500 |
parents | 2e429e2b7bb6 |
children | 5ba2508939f7 |
comparison
equal
deleted
inserted
replaced
962:10e7570a3aab | 963:4619290d171d |
---|---|
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) |