def save(_handler, categoria_id, **categoria_properties): cmd = facade.update_categoria_cmd(categoria_id, **categoria_properties) try: cmd() except CommandExecutionException: context = {'errors': cmd.errors, 'categoria': cmd.form} return TemplateResponse(context, 'categorias/admin/form.html') _handler.redirect(router.to_path(admin))
def update(categoria_id, **categoria_properties): cmd = facade.update_categoria_cmd(categoria_id, **categoria_properties) return _save_or_update_json_response(cmd)