Skip to content

Commit

Permalink
style: [AXIMST-28] fix pylint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
NiedielnitsevIvan committed Apr 8, 2024
1 parent 5b879da commit 3ecbbd6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 23 deletions.
30 changes: 9 additions & 21 deletions cms/djangoapps/contentstore/views/block.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from web_fragments.fragment import Fragment

from cms.lib.xblock.authoring_mixin import VISIBILITY_VIEW
from common.djangoapps.edxmako.shortcuts import render_to_string
from common.djangoapps.edxmako.shortcuts import render_to_response, render_to_string
from common.djangoapps.student.auth import (
has_studio_read_access,
has_studio_write_access,
Expand Down Expand Up @@ -299,15 +299,17 @@ def xblock_view_handler(request, usage_key_string, view_name):
else:
return HttpResponse(status=406)

from common.djangoapps.edxmako.shortcuts import render_to_response

@require_http_methods("GET")
@login_required
def partial_edit_view_xblock(request,usage_key_string):
def partial_edit_view_xblock(request, usage_key_string):
"""
The restful handler for requests for rendered xblock views.
"""
usage_key = usage_key_with_run(usage_key_string)
if not has_studio_read_access(request.user, usage_key.course_key):
raise PermissionDenied()


store = modulestore()
xblock = store.get_item(usage_key)

Expand All @@ -332,7 +334,6 @@ def partial_edit_view_xblock(request,usage_key_string):
)
)


load_services_for_studio(xblock.runtime, request.user)

# try:
Expand All @@ -354,8 +355,7 @@ def partial_edit_view_xblock(request,usage_key_string):
# 'reorderable_container_child_preview' is only rendered for xblocks that
# are being shown in a reorderable container, so the xblock is automatically
# added to the list.
reorderable_items = set()

# reorderable_items = set()

force_render = request.GET.get("force_render", None)

Expand Down Expand Up @@ -398,21 +398,9 @@ def partial_edit_view_xblock(request,usage_key_string):
},
)

from ..utils import get_container_handler_context # pylint: disable=import-outside-toplevel
from .component import _get_item_in_course # pylint: disable=import-outside-toplevel

fragment_content = studio_fragment.content
if isinstance(fragment_content, bytes):
fragment_content = studio_fragment.content.decode("utf-8")

context = {
"studio_fragment": studio_fragment,
"wrapper_fragment": wrapper_fragment,
"is_learning_mfe":True

}

from ..utils import get_container_handler_context
from .component import _get_item_in_course
# return render_to_response('courseware-chromeless.html', context)
usage_key = usage_key_with_run(usage_key_string)
with modulestore().bulk_operations(usage_key.course_key):
course, xblock, lms_link, preview_lms_link = _get_item_in_course(request, usage_key)
Expand Down
1 change: 0 additions & 1 deletion cms/templates/container_editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
from openedx.core.djangolib.markup import HTML
from openedx.core.release import RELEASE_LINE
%>
<%page expression_filter="h"/>
<%def name="online_help_token()">
<%
return "container"
Expand Down
2 changes: 1 addition & 1 deletion cms/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
re_path(fr'^xblock/container/{settings.USAGE_KEY_PATTERN}$', contentstore_views.xblock_container_handler,
name='xblock_container_handler'),
re_path(fr'^xblock/{settings.USAGE_KEY_PATTERN}/editor$', partial_edit_view_xblock,
name='xblock_editor_handler'),
name='xblock_editor_handler'),
re_path(fr'^xblock/{settings.USAGE_KEY_PATTERN}/(?P<view_name>[^/]+)$', contentstore_views.xblock_view_handler,
name='xblock_view_handler'),
re_path(fr'^xblock/{settings.USAGE_KEY_PATTERN}?$', contentstore_views.xblock_handler,
Expand Down

0 comments on commit 3ecbbd6

Please sign in to comment.