def do_post(self, req): req.perm.assert_permission(Action.CONTINGENT_ADD_TIME) sprint = self._get_sprint(req) added_times = self._extract_added_times(req) cc = ContingentController(self.env) for name, amount in added_times.items(): cmd = ContingentController.AddTimeToContingentCommand( self.env, sprint=sprint.name, name=name, delta=amount) cc.process_command(cmd) req.redirect(self.get_redirect_url(req, sprint))
def _add_time_to_contingent(self, contingent_name, sprint, nr_hours): self._clear_model_cache() cmd = ContingentController.AddTimeToContingentCommand(self.env, name=contingent_name, sprint=sprint.name, delta=str(nr_hours)) return ContingentController(self.env).process_command(cmd)