Beispiel #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))
Beispiel #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))
Beispiel #3
0
def save(**course_properties):
    cmd = facade.save_course_cmd(**course_properties)
    return _save_or_update_json_response(cmd)
Beispiel #4
0
def save(**course_properties):
    cmd = facade.save_course_cmd(**course_properties)
    return _save_or_update_json_response(cmd)