def save_post(self, post):
    published = False
    if ((post.pk is None) or Post.objects.filter(pk=post.pk, published=None).count()):
        if (self.cleaned_data['state'] == Post.STATE_CHOICES[(- 1)][0]):
            post.published = timezone.now()
            published = True
    render_func = curry(load_path_attr(settings.PINAX_BLOG_MARKUP_CHOICE_MAP[self.markup_choice]['parser']))
    post.teaser_html = render_func(self.cleaned_data['teaser'])
    post.content_html = render_func(self.cleaned_data['content'])
    post.updated = timezone.now()
    post.save()
    r = Revision()
    r.post = post
    r.title = post.title
    r.teaser = self.cleaned_data['teaser']
    r.content = self.cleaned_data['content']
    r.author = post.author
    r.updated = post.updated
    r.published = post.published
    r.save()
    if published:
        post_published.send(sender=Post, post=post)
    return post
def save_post(self, post):
    published = False
    if ((post.pk is None) or Post.objects.filter(pk=post.pk, published=None).count()):
        if (self.cleaned_data['state'] == Post.STATE_CHOICES[(- 1)][0]):
            post.published = timezone.now()
            published = True
    render_func = curry(load_path_attr(settings.PINAX_BLOG_MARKUP_CHOICE_MAP[self.markup_choice]['parser']))
    post.teaser_html = render_func(self.cleaned_data['teaser'])
    post.content_html = render_func(self.cleaned_data['content'])
    post.updated = timezone.now()
    post.save()
    r = Revision()
    r.post = post
    r.title = post.title
    r.teaser = self.cleaned_data['teaser']
    r.content = self.cleaned_data['content']
    r.author = post.author
    r.updated = post.updated
    r.published = post.published
    r.save()
    if published:
        post_published.send(sender=Post, post=post)
    return post