Exemple #1
0
    def commit(self, title):
        new_content = request.POST['article-text']
        if new_content[-1] != '\n':
            new_content += '\n'

        author = request.POST['author-name']

        try:
            e = h.Email(resolve_domain=True)
            email = e.to_python(request.POST['author-email'])
        except h.Invalid as i:
            return i

        message = request.POST['message']

        article = Article(title)
        article.update_content(new_content, author, email, message)

        h.redirect(h.url_for('index'))
Exemple #2
0
    def edit(self, title):
        article = Article(title)

        c.title = article.get_title()
        c.content = article.get_content()
        return render('/article-edit.mako')