Skip to content

Commit

Permalink
fix: display not authorized on course create
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian2012 committed Dec 20, 2022
1 parent 5955a50 commit 72db189
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cms/djangoapps/contentstore/views/course.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@
from common.djangoapps.course_action_state.models import CourseRerunState, CourseRerunUIStateManager
from common.djangoapps.course_modes.models import CourseMode
from common.djangoapps.edxmako.shortcuts import render_to_response
from common.djangoapps.student import auth
from common.djangoapps.student.auth import has_course_author_access, has_studio_read_access, has_studio_write_access
from common.djangoapps.student.roles import (
CourseCreatorRole,
CourseInstructorRole,
CourseStaffRole,
GlobalStaff,
Expand Down Expand Up @@ -873,6 +875,8 @@ def _create_or_rerun_course(request):
try:
org = request.json.get('org')

course = request.json.get('number', request.json.get('course'))

rerun_permission = (
OrgRerunCreatorRole(org).has_user(request.user)
or OrgCourseCreatorRole(org).has_user(request.user)
Expand All @@ -881,7 +885,6 @@ def _create_or_rerun_course(request):
if not auth.user_has_role(request.user, CourseCreatorRole()) and not rerun_permission:
raise PermissionDenied()

course = request.json.get('number', request.json.get('course'))
display_name = request.json.get('display_name')
# force the start date for reruns and allow us to override start via the client
start = request.json.get('start', CourseFields.start.default)
Expand Down

0 comments on commit 72db189

Please sign in to comment.