Пример #1
0
def save(course_id, **course_properties):
    cmd = course_facade.update_course_cmd(course_id, **course_properties)
    try:
        cmd()
    except CommandExecutionException:
        context = {'errors': cmd.errors, 'course': course_properties}

        return TemplateResponse(context, 'courses/course_form.html')
    return RedirectResponse(router.to_path(courses))
Пример #2
0
def save(course_id, **course_properties):
    cmd = course_facade.update_course_cmd(course_id, **course_properties)
    try:
        cmd()
    except CommandExecutionException:
        context = {'errors': cmd.errors, 'course': course_properties}

        return TemplateResponse(context, 'courses/course_form.html')
    return RedirectResponse(router.to_path(courses))
Пример #3
0
def edit(_resp, course_id, **course_properties):
    cmd = course_facade.update_course_cmd(course_id, **course_properties)
    return _save_or_update_json_response(cmd, _resp)