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"))
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"))
def call(self, subject, text): return accept_question(self.session, self.participation, self.timestamp, subject, text)