def set_task_status(self, task): # self.request.POST is a locked dict, we need a non locked one params = dict(self.request.POST) status = params['submit'] task.set_status(status, self.request, self.request.user.id, **params) self.request.registry.notify(StatusChanged( self.request, task, status, )) return task
def set_task_status(self, task): # self.request.POST is a locked dict, we need a non locked one params = dict(self.request.POST) status = params['submit'] task.set_status(status, self.request, self.request.user.id, **params) self.request.registry.notify( StatusChanged( self.request, task, status, )) return task
def delete(request): """ delete a task """ task = request.context user = request.user project = task.project log.info(u"# {user.login} deletes {s.__name__} {s.number}".format( user=user, s=task)) try: task.set_status("delete", request, request.user.id) except Forbidden, err: log.exception(u"Forbidden operation") request.session.flash(err.message, queue="error")