from Course.models import Course
from base.decorator import require_get, require_login, require_post, require_json, require_params
from base.error import Error
from base.response import error_response, response


@require_get
@require_login
def get_course_info(request, course_id):
    """GET /api/courses/:course_id"""
    ret = Course.get_course_by_id(course_id)
    if ret.error is not Error.OK:
        return error_response(ret.error)
    o_course = ret.body
    return response(body=o_course.to_dict())

e8dfea11f413352505973c62b8b63039440ecca5
<mask token>

<mask token>


@require_get
@require_login
def get_course_info(request, course_id):
    """GET /api/courses/:course_id"""
    ret = Course.get_course_by_id(course_id)
    if ret.error is not Error.OK:
        return error_response(ret.error)
    o_course = ret.body
    return response(body=o_course.to_dict())

from Course.models import Course
from base.decorator import require_get, require_login, require_post, require_json, require_params
from base.error import Error
from base.response import error_response, response


@require_get
@require_login
def get_course_info(request, course_id):
    """GET /api/courses/:course_id"""
    ret = Course.get_course_by_id(course_id)
    if ret.error is not Error.OK:
        return error_response(ret.error)
    o_course = ret.body
    return response(body=o_course.to_dict())
