Ejemplo n.º 1
0
 def _process(self):
     form = PaperCommentForm(paper=self.paper, user=session.user)
     if form.validate_on_submit():
         visibility = form.visibility.data if form.visibility else None
         create_comment(self.paper, form.text.data, visibility, session.user)
         return jsonify_data(flash=False, html=render_paper_page(self.paper))
     tpl = get_template_module('events/reviews/forms.html')
     return jsonify(html=tpl.render_comment_form(form, proposal=self.paper))
Ejemplo n.º 2
0
 def _process(self):
     form = PaperCommentForm(paper=self.paper, user=session.user)
     if form.validate_on_submit():
         visibility = form.visibility.data if form.visibility else None
         create_comment(self.paper, form.text.data, visibility,
                        session.user)
         return jsonify_data(flash=False,
                             html=render_paper_page(self.paper))
     tpl = get_template_module('events/reviews/forms.html')
     return jsonify(html=tpl.render_comment_form(form, proposal=self.paper))
Ejemplo n.º 3
0
 def _process(self, comment, visibility):
     create_comment(self.paper, comment, visibility, session.user)
     return '', 204