Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: [AXIMST-432] 500 error appears if user adds a Content Experiment #2502

Merged
merged 1 commit into from
Feb 2, 2024

Conversation

ruzniaievdm
Copy link

@ruzniaievdm ruzniaievdm commented Feb 1, 2024

AXIMST-432

The problem arose at the stage of defining icons for children xblock's of the unit.
Just when we tried to get get_icon_class() for split_test xblock.
It was made decision to skip it.

File "/edx/app/edxapp/edx-platform/xmodule/vertical_block.py", line 254, in get_icon_class
    child_classes = {child.get_icon_class() for child in self.get_children()}
  File "/edx/app/edxapp/edx-platform/xmodule/vertical_block.py", line 254, in <setcomp>
    child_classes = {child.get_icon_class() for child in self.get_children()}
  File "/edx/app/edxapp/edx-platform/xmodule/split_test_block.py", line 398, in get_icon_class
    return self.child.get_icon_class() if self.child else 'other'
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/django/utils/functional.py", line 48, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/edx/app/edxapp/edx-platform/xmodule/split_test_block.py", line 176, in child
    if self.child_block is not None:
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/django/utils/functional.py", line 48, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/edx/app/edxapp/edx-platform/xmodule/split_test_block.py", line 166, in child_block
    child_blocks = self.get_child_blocks()
  File "/edx/app/edxapp/edx-platform/xmodule/split_test_block.py", line 216, in get_child_blocks
    group_id = self.get_group_id()
  File "/edx/app/edxapp/edx-platform/xmodule/split_test_block.py", line 243, in get_group_id
    user_service = self.runtime.service(self, 'user')
  File "/edx/app/edxapp/edx-platform/xmodule/modulestore/split_mongo/caching_descriptor_system.py", line 245, in service
    return super().service(block, service_name)
  File "/edx/app/edxapp/edx-platform/xmodule/x_module.py", line 1502, in service
    service = super().service(block=block, service_name=service_name)
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/xblock/runtime.py", line 1125, in service
    raise NoSuchServiceError(f"Service {service_name!r} is not available.")
xblock.exceptions.NoSuchServiceError: Service 'user' is not available.

@ruzniaievdm ruzniaievdm self-assigned this Feb 1, 2024
@ruzniaievdm ruzniaievdm force-pushed the ruzniaievdm/fix/500-content-exp branch from 1cbf6d5 to 43062f5 Compare February 2, 2024 10:39
@ruzniaievdm ruzniaievdm force-pushed the ruzniaievdm/fix/500-content-exp branch from 43062f5 to e9ec189 Compare February 2, 2024 10:41
@GlugovGrGlib
Copy link
Collaborator

cms/djangoapps/contentstore/views/tests/test_container_page.py - was reverted to master revision

@GlugovGrGlib GlugovGrGlib merged commit 9bdd246 into ts-develop Feb 2, 2024
45 checks passed
@GlugovGrGlib
Copy link
Collaborator

GlugovGrGlib commented Feb 2, 2024

The bug with get_icon for sequences if Split_test block is added should be discussed with 2U/AXIM

  return block.get_icon_class()
  File "/edx/app/edxapp/edx-platform/xmodule/vertical_block.py", line 254, in get_icon_class
    child_classes = {child.get_icon_class() for child in self.get_children()}
  File "/edx/app/edxapp/edx-platform/xmodule/vertical_block.py", line 254, in <setcomp>
    child_classes = {child.get_icon_class() for child in self.get_children()}
  File "/edx/app/edxapp/edx-platform/xmodule/split_test_block.py", line 398, in get_icon_class
    return self.child.get_icon_class() if self.child else 'other'
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/django/utils/functional.py", line 48, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/edx/app/edxapp/edx-platform/xmodule/split_test_block.py", line 176, in child
    if self.child_block is not None:
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/django/utils/functional.py", line 48, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/edx/app/edxapp/edx-platform/xmodule/split_test_block.py", line 166, in child_block
    child_blocks = self.get_child_blocks()
  File "/edx/app/edxapp/edx-platform/xmodule/split_test_block.py", line 216, in get_child_blocks
    group_id = self.get_group_id()
  File "/edx/app/edxapp/edx-platform/xmodule/split_test_block.py", line 245, in get_group_id
    return partitions_service.get_user_group_id_for_partition(user, self.user_partition_id)
  File "/edx/app/edxapp/edx-platform/xmodule/partitions/partitions_service.py", line 146, in get_user_group_id_for_partition
    raise ValueError(
ValueError: Configuration problem!  No user_partition with id -1 in course course-v1:QA+certificate+2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants