Пример #1
0
 def _process(self):
     form = AbstractCommentForm(abstract=self.abstract, user=session.user)
     if form.validate_on_submit():
         create_abstract_comment(self.abstract, form.data)
         return jsonify_data(flash=False, html=render_abstract_page(self.abstract, management=self.management))
     tpl = get_template_module('events/reviews/forms.html')
     return jsonify(html=tpl.render_comment_form(form, proposal=self.abstract))
Пример #2
0
 def _process(self):
     form = AbstractCommentForm(abstract=self.abstract, user=session.user)
     if form.validate_on_submit():
         create_abstract_comment(self.abstract, form.data)
         return jsonify_data(flash=False, html=render_abstract_page(self.abstract, management=self.management))
     tpl = get_template_module('events/reviews/forms.html')
     return jsonify(html=tpl.render_comment_form(form, proposal=self.abstract))
Пример #3
0
    def _process(self):
        form = AbstractCommentForm(abstract=self.abstract, user=session.user)
        if form.validate_on_submit():
            create_abstract_comment(self.abstract, form.data)
            if abstracts_reviewing_settings.get(self.event,
                                                'notify_on_new_comments'):
                visibility = form.visibility.data if form.visibility else AbstractCommentVisibility.contributors
                recipients = self._get_recipients(visibility) - {session.user}
                comment = form.text.data
                self._send_notification(recipients, comment)

            return jsonify_data(flash=False,
                                html=render_abstract_page(
                                    self.abstract, management=self.management))
        tpl = get_template_module('events/reviews/forms.html')
        return jsonify(
            html=tpl.render_comment_form(form, proposal=self.abstract))