示例#1
0
 def _process(self):
     role = PaperReviewingRole[request.view_args['role']]
     deadline = paper_reviewing_settings.get(self.event, '{}_deadline'.format(role.name))
     enforce = paper_reviewing_settings.get(self.event, 'enforce_{}_deadline'.format(role.name))
     form = DeadlineForm(obj=FormDefaults(deadline=deadline, enforce=enforce), event=self.event)
     if form.validate_on_submit():
         set_deadline(self.event, role, form.deadline.data, form.enforce.data)
         messages = {
             PaperReviewingRole.content_reviewer: _('Content reviewing deadline has been set.'),
             PaperReviewingRole.layout_reviewer: _('Layout reviewing deadline has been set.'),
             PaperReviewingRole.judge: _('Judging deadline has been set.')
         }
         flash(messages[role], 'success')
         return jsonify_data(html=_render_paper_dashboard(self.event))
     return jsonify_form(form)
示例#2
0
 def _process(self):
     role = PaperReviewingRole[request.view_args['role']]
     deadline = paper_reviewing_settings.get(self.event, '{}_deadline'.format(role.name))
     enforce = paper_reviewing_settings.get(self.event, 'enforce_{}_deadline'.format(role.name))
     form = DeadlineForm(obj=FormDefaults(deadline=deadline, enforce=enforce), event=self.event)
     if form.validate_on_submit():
         set_deadline(self.event, role, form.deadline.data, form.enforce.data)
         messages = {
             PaperReviewingRole.content_reviewer: _('Content reviewing deadline has been set.'),
             PaperReviewingRole.layout_reviewer: _('Layout reviewing deadline has been set.'),
             PaperReviewingRole.judge: _('Judging deadline has been set.')
         }
         flash(messages[role], 'success')
         return jsonify_data(html=_render_paper_dashboard(self.event))
     return jsonify_form(form)