Exemplo n.º 1
0
def save(_handler, course_id=None, **course_properties):
    cmd = facade.save_course_cmd(**course_properties)
    try:
        cmd()
    except CommandExecutionException:
        context = {'errors': cmd.errors, 'course': cmd.form}

        return TemplateResponse(context, 'courses/admin/form.html')
    _handler.redirect(router.to_path(admin))
Exemplo n.º 2
0
def save(_handler, course_id=None, **course_properties):
    cmd = facade.save_course_cmd(**course_properties)
    try:
        cmd()
    except CommandExecutionException:
        context = {'errors': cmd.errors,
                   'course': cmd.form}

        return TemplateResponse(context, 'trailers/admin/form.html')
    _handler.redirect(router.to_path(admin))
Exemplo n.º 3
0
def save(**course_properties):
    cmd = facade.save_course_cmd(**course_properties)
    return _save_or_update_json_response(cmd)
Exemplo n.º 4
0
def save(**course_properties):
    cmd = facade.save_course_cmd(**course_properties)
    return _save_or_update_json_response(cmd)