'This method force publishes a course if dry-run argument is not selected. If dry-run is selected, this view
shows possible outcome if the `force_publish_course` modulestore method is executed.
Arguments:
course_id (string): a request parameter containing course id
is_dry_run (string): a request parameter containing dry run value.
It is obtained from checkbox so it has either values \'on\' or \'\'.'

@transaction.atomic
@method_decorator(require_global_staff)
def post(self, request):

    course_id = request.POST.get('course-id')
    self.context.update({'form_data': {'course_id': course_id}})
    try:
        course_usage_key = self.validate_course_key(course_id)
    except InvalidKeyError:
        self.context['error'] = True
        self.context['msg'] = COURSE_KEY_ERROR_MESSAGES['invalid_course_key']
    except ItemNotFoundError as exc:
        self.context['error'] = True
        self.context['msg'] = exc.message
    except ValidationError as exc:
        self.context['error'] = True
        self.context['msg'] = exc.message
    if self.context['error']:
        return self.render_response()
    source_store = modulestore()._get_modulestore_for_courselike(course_usage_key)
    if (not hasattr(source_store, 'force_publish_course')):
        self.context['msg'] = _('Force    publishing    course    is    not    supported    with    old    mongo    courses.')
        log.warning('Force    publishing    course    is    not    supported    with    old    mongo    courses.                                                                    %s    attempted    to    force    publish    the    course    %s.', request.user, course_id, exc_info=True)
        return self.render_response()
    current_versions = self.get_course_branch_versions(get_course_versions(course_id))
    if (current_versions['published-branch'] == current_versions['draft-branch']):
        self.context['msg'] = _('Course    is    already    in    published    state.')
        log.warning('Course    is    already    in    published    state.    %s    attempted    to    force    publish    the    course    %s.', request.user, course_id, exc_info=True)
        return self.render_response()
    self.context['current_versions'] = current_versions
    log.info('%s    dry    ran    force    publish    the    course    %s.', request.user, course_id, exc_info=True)
    return self.render_response()
