def decide(self): """Decide the current agendaitem and move the meeting in the held state. """ self.require_editable() meeting_state = self.meeting.get_state() error_response = self._checkin_proposal_document_before_deciding() if error_response: return error_response self.agenda_item.decide() response = JSONResponse(self.request) response.info( _(u'agenda_item_decided', default=u'Agenda Item decided.')) if meeting_state != self.meeting.get_state(): response.redirect(self.context.absolute_url()) msg = _( u'agenda_item_meeting_held', default= u"Agendaitem has been decided and the meeting has been held.") api.portal.show_message(message=msg, request=self.request, type='info') return response.dump()
def __call__(self): transition = self.request.get('transition') response = JSONResponse(self.request) errors = self.get_transition_validation_errors(transition) if errors: map(response.error, errors) response.remain() elif not self.is_valid_transition(transition): raise BadRequest() else: self.execute_transition(transition) response.info( _('label_transition_executed', default='Transition ${transition} executed', mapping={ 'transition': self.model.workflow.transitions.get(transition).title })) response.redirect(self.model.get_url()) return response.dump()