def post(self): try: printjob = accept_print_job( self.sql_session, self.service.file_cacher, self.current_user, self.timestamp, self.request.files) self.sql_session.commit() except PrintingDisabled: raise tornado_web.HTTPError(404) except UnacceptablePrintJob as e: self.notify_error(e.subject, e.text) else: self.service.printing_service.new_printjob(printjob_id=printjob.id) self.notify_success(N_("Print job received"), N_("Your print job has been received.")) self.redirect(self.contest_url("printing"))
def post(self): try: printjob = accept_print_job( self.sql_session, self.service.file_cacher, self.current_user, self.timestamp, self.request.files) self.sql_session.commit() except PrintingDisabled: raise tornado.web.HTTPError(404) except UnacceptablePrintJob as e: self.notify_error(e.subject, e.text, e.text_params) else: self.service.printing_service.new_printjob(printjob_id=printjob.id) self.notify_success(N_("Print job received"), N_("Your print job has been received.")) self.redirect(self.contest_url("printing"))
def call(self, files): return accept_print_job(self.session, self.file_cacher, self.participation, self.timestamp, files)