|
|
@ -222,7 +222,7 @@ def course_info(course_uuid): |
|
|
|
# Only allow owner or admin to query info for course that is not published or is pending |
|
|
|
# Only allow owner or admin to query info for course that is not published or is pending |
|
|
|
if not selected_course.isActive or selected_course.publishedStatus != int(PublishedStatus.APPROVED): |
|
|
|
if not selected_course.isActive or selected_course.publishedStatus != int(PublishedStatus.APPROVED): |
|
|
|
if g.get("is_authed"): |
|
|
|
if g.get("is_authed"): |
|
|
|
if g.current_user.role == int(UserRole.ADMIN) or g.current_user.id == selected_course.authorID |
|
|
|
if g.current_user.role == int(UserRole.ADMIN) or g.current_user.id == selected_course.authorID: |
|
|
|
pass |
|
|
|
pass |
|
|
|
else: |
|
|
|
else: |
|
|
|
return jsonify({'message': 'The course does not exist.'}), 404 |
|
|
|
return jsonify({'message': 'The course does not exist.'}), 404 |
|
|
|