예제 #1
0
    def post(self):
        try:
            accept_question(self.sql_session, self.current_user, self.timestamp,
                            self.get_argument("question_subject", ""),
                            self.get_argument("question_text", ""))
            self.sql_session.commit()
        except QuestionsNotAllowed:
            raise tornado_web.HTTPError(404)
        except UnacceptableQuestion as e:
            self.notify_error(e.subject, e.text, e.text_params)
        else:
            self.notify_success(N_("Question received"),
                                N_("Your question has been received, you "
                                   "will be notified when it is answered."))

        self.redirect(self.contest_url("communication"))
예제 #2
0
파일: communication.py 프로젝트: Nyrio/cms
    def post(self):
        try:
            accept_question(self.sql_session, self.current_user, self.timestamp,
                            self.get_argument("question_subject", ""),
                            self.get_argument("question_text", ""))
            self.sql_session.commit()
        except QuestionsNotAllowed:
            raise tornado.web.HTTPError(404)
        except UnacceptableQuestion as e:
            self.notify_error(e.subject, e.text)
        else:
            self.notify_success(N_("Question received"),
                                N_("Your question has been received, you "
                                   "will be notified when it is answered."))

        self.redirect(self.contest_url("communication"))
예제 #3
0
 def call(self, subject, text):
     return accept_question(self.session, self.participation,
                            self.timestamp, subject, text)
예제 #4
0
 def call(self, subject, text):
     return accept_question(self.session, self.participation,
                            self.timestamp, subject, text)