diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/posts/models.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/posts/models.py b/app/posts/models.py index 7e05ebb..b92518c 100644 --- a/app/posts/models.py +++ b/app/posts/models.py @@ -64,6 +64,7 @@ class Post(models.Model): (1, 'review'), (2, 'essay'), (3, 'src'), + (4, 'jrnl'), ) post_type = models.IntegerField(choices=POST_TYPE, default=0) template_name = models.IntegerField(choices=TEMPLATES, default=0) @@ -143,8 +144,10 @@ class Post(models.Model): md = render_images(self.body_markdown) prods = render_products(md) self.body_html = markdown_to_html(prods) - self.epilogue_html = markdown_to_html(self.epilogue_markdown) - self.prologue_html = markdown_to_html(self.prologue_markdown) + if self.epilogue_html: + self.epilogue_html = markdown_to_html(self.epilogue_markdown) + if self.prologue_html: + self.prologue_html = markdown_to_html(self.prologue_markdown) self.has_video = parse_video(self.body_html) if self.point: try: @@ -212,6 +215,7 @@ class PostSitemap(Sitemap): def lastmod(self, obj): return obj.pub_date + """ for p in src: s, created = Post.objects.get_or_create( |