Example #1
0
def save(curso_id, **curso_properties):
    cmd = curso_facade.update_curso_cmd(curso_id, **curso_properties)
    try:
        cmd()
    except CommandExecutionException:
        context = {'errors': cmd.errors, 'curso': curso_properties}

        return TemplateResponse(context, 'cursos/curso_form.html')
    return RedirectResponse(router.to_path(cursos))
Example #2
0
def edit(_resp, id, **curso_properties):
    cmd = curso_facade.update_curso_cmd(id, **curso_properties)
    return _save_or_update_json_response(cmd, _resp)