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

Need to remove references to old account toggles #126

Open
kdmccormick opened this issue Feb 14, 2025 · 1 comment · Fixed by #127
Open

Need to remove references to old account toggles #126

kdmccormick opened this issue Feb 14, 2025 · 1 comment · Fixed by #127
Assignees
Labels
bug Something isn't working

Comments

@kdmccormick
Copy link
Contributor

Expected

After logging into LMS, the learner dashboard should load.

Actual

500 error:

ModuleNotFoundError: No module named 'openedx.core.djangoapps.user_api.accounts.toggles'

Other information

The legacy profile, account, and order history pages were recently removed from edx-platform:

I believe the cause of the Indigo 500 is that Indigo is references toggles from these old pages.

It should be pretty straightforward to remove these old toggles and fix Indigo.

Note: This bug is not currently affecting the default Open edX theme.

Full LMS logs

lms-1  | Traceback (most recent call last):
lms-1  |   File "/openedx/venv/lib/python3.11/site-packages/django/core/handlers/exception.py", line 55, in inner
lms-1  |     response = get_response(request)
lms-1  |                ^^^^^^^^^^^^^^^^^^^^^
lms-1  |   File "/openedx/venv/lib/python3.11/site-packages/django/core/handlers/base.py", line 197, in _get_response
lms-1  |     response = wrapped_callback(request, *callback_args, **callback_kwargs)
lms-1  |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lms-1  |   File "/opt/pyenv/versions/3.11.8/lib/python3.11/contextlib.py", line 81, in inner
lms-1  |     return func(*args, **kwds)
lms-1  |            ^^^^^^^^^^^^^^^^^^^
lms-1  |   File "/openedx/venv/lib/python3.11/site-packages/django/contrib/auth/decorators.py", line 23, in _wrapper_view
lms-1  |     return view_func(request, *args, **kwargs)
lms-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lms-1  |   File "/openedx/venv/lib/python3.11/site-packages/django/utils/decorators.py", line 134, in _wrapper_view
lms-1  |     response = view_func(request, *args, **kwargs)
lms-1  |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lms-1  |   File "/openedx/edx-platform/openedx/core/djangoapps/util/maintenance_banner.py", line 42, in _decorated
lms-1  |     return func(request, *args, **kwargs)
lms-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lms-1  |   File "/openedx/edx-platform/common/djangoapps/student/views/dashboard.py", line 899, in student_dashboard
lms-1  |     response = render_to_response(dashboard_template, context)
lms-1  |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lms-1  |   File "/openedx/edx-platform/common/djangoapps/edxmako/shortcuts.py", line 188, in render_to_response
lms-1  |     return HttpResponse(render_to_string(template_name, dictionary, namespace, request), **kwargs)
lms-1  |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lms-1  |   File "/openedx/edx-platform/common/djangoapps/edxmako/shortcuts.py", line 178, in render_to_string
lms-1  |     return template.render(dictionary, request)
lms-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lms-1  |   File "/openedx/edx-platform/common/djangoapps/edxmako/template.py", line 82, in render
lms-1  |     return self.mako_template.render_unicode(**context_dictionary)
lms-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lms-1  |   File "/openedx/venv/lib/python3.11/site-packages/mako/template.py", line 443, in render_unicode
lms-1  |     return runtime._render(
lms-1  |            ^^^^^^^^^^^^^^^^
lms-1  |   File "/openedx/venv/lib/python3.11/site-packages/mako/runtime.py", line 874, in _render
lms-1  |     _render_context(
lms-1  |   File "/openedx/venv/lib/python3.11/site-packages/mako/runtime.py", line 916, in _render_context
lms-1  |     _exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
lms-1  |   File "/openedx/venv/lib/python3.11/site-packages/mako/runtime.py", line 943, in _exec_template
lms-1  |     callable_(context, *args, **kwargs)
lms-1  |   File "/tmp/mako_lms/1ff981c2157d500713c1ce6bf7fdbce2/main.html.py", line 378, in render_body
lms-1  |     runtime._include_file(context, (static.get_template_path('header.html')), _template_uri, online_help_token=online_help_token)
lms-1  |   File "/openedx/venv/lib/python3.11/site-packages/mako/runtime.py", line 793, in _include_file
lms-1  |     callable_(ctx, **kwargs)
lms-1  |   File "/tmp/mako_lms/1ff981c2157d500713c1ce6bf7fdbce2/header.html.py", line 34, in render_body
lms-1  |     runtime._include_file(context, (static.get_template_path(relative_path='header/header.html')), _template_uri, online_help_token=online_help_token)
lms-1  |   File "/openedx/venv/lib/python3.11/site-packages/mako/runtime.py", line 793, in _include_file
lms-1  |     callable_(ctx, **kwargs)
lms-1  |   File "/tmp/mako_lms/1ff981c2157d500713c1ce6bf7fdbce2/indigo/lms/templates/header/header.html.py", line 99, in render_body
lms-1  |     runtime._include_file(context, 'navbar-authenticated.html', _template_uri, online_help_token=online_help_token)
lms-1  |   File "/openedx/venv/lib/python3.11/site-packages/mako/runtime.py", line 793, in _include_file
lms-1  |     callable_(ctx, **kwargs)
lms-1  |   File "/tmp/mako_lms/1ff981c2157d500713c1ce6bf7fdbce2/indigo/lms/templates/header/navbar-authenticated.html.py", line 106, in render_body
lms-1  |     runtime._include_file(context, 'user_dropdown.html', _template_uri)
lms-1  |   File "/openedx/venv/lib/python3.11/site-packages/mako/runtime.py", line 780, in _include_file
lms-1  |     template = _lookup_template(context, uri, calling_uri)
lms-1  |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lms-1  |   File "/openedx/venv/lib/python3.11/site-packages/mako/runtime.py", line 837, in _lookup_template
lms-1  |     return lookup.get_template(uri)
lms-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^
lms-1  |   File "/openedx/edx-platform/common/djangoapps/edxmako/paths.py", line 99, in get_template
lms-1  |     template = super().get_template(get_template_path_with_theme(uri))
lms-1  |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lms-1  |   File "/openedx/venv/lib/python3.11/site-packages/mako/lookup.py", line 251, in get_template
lms-1  |     return self._load(srcfile, uri)
lms-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^
lms-1  |   File "/openedx/venv/lib/python3.11/site-packages/mako/lookup.py", line 312, in _load
lms-1  |     self._collection[uri] = template = Template(
lms-1  |                                        ^^^^^^^^^
lms-1  |   File "/openedx/venv/lib/python3.11/site-packages/mako/template.py", line 316, in __init__
lms-1  |     module = self._compile_from_file(path, filename)
lms-1  |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lms-1  |   File "/openedx/venv/lib/python3.11/site-packages/mako/template.py", line 380, in _compile_from_file
lms-1  |     module = compat.load_module(self.module_id, path)
lms-1  |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lms-1  |   File "/openedx/venv/lib/python3.11/site-packages/mako/compat.py", line 53, in load_module
lms-1  |     spec.loader.exec_module(module)
lms-1  |   File "<frozen importlib._bootstrap_external>", line 940, in exec_module
lms-1  |   File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
lms-1  |   File "/tmp/mako_lms/1ff981c2157d500713c1ce6bf7fdbce2/indigo/lms/templates/header/user_dropdown.html.py", line 24, in <module>
lms-1  |     from openedx.core.djangoapps.user_api.accounts.toggles import should_redirect_to_order_history_microfrontend
lms-1  | ModuleNotFoundError: No module named 'openedx.core.djangoapps.user_api.accounts.toggles'
lms-1  | 2025-02-14 22:56:57,850 ERROR 22 [django.request] [user None] [ip None] log.py:241 - Internal Server Error: /dashboard
lms-1  | Traceback (most recent call last):
lms-1  |   File "/openedx/venv/lib/python3.11/site-packages/mako/lookup.py", line 240, in get_template
lms-1  |     return self._check(uri, self._collection[uri])
lms-1  |                             ~~~~~~~~~~~~~~~~^^^^^
lms-1  | KeyError: 'indigo/lms/templates/header/user_dropdown.html'
lms-1  | 
lms-1  | During handling of the above exception, another exception occurred:
lms-1  | 
lms-1  | Traceback (most recent call last):
lms-1  |   File "/openedx/venv/lib/python3.11/site-packages/django/core/handlers/exception.py", line 55, in inner
lms-1  |     response = get_response(request)
lms-1  |                ^^^^^^^^^^^^^^^^^^^^^
lms-1  |   File "/openedx/venv/lib/python3.11/site-packages/django/core/handlers/base.py", line 197, in _get_response
lms-1  |     response = wrapped_callback(request, *callback_args, **callback_kwargs)
lms-1  |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lms-1  |   File "/opt/pyenv/versions/3.11.8/lib/python3.11/contextlib.py", line 81, in inner
lms-1  |     return func(*args, **kwds)
lms-1  |            ^^^^^^^^^^^^^^^^^^^
lms-1  |   File "/openedx/venv/lib/python3.11/site-packages/django/contrib/auth/decorators.py", line 23, in _wrapper_view
lms-1  |     return view_func(request, *args, **kwargs)
lms-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lms-1  |   File "/openedx/venv/lib/python3.11/site-packages/django/utils/decorators.py", line 134, in _wrapper_view
lms-1  |     response = view_func(request, *args, **kwargs)
lms-1  |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lms-1  |   File "/openedx/edx-platform/openedx/core/djangoapps/util/maintenance_banner.py", line 42, in _decorated
lms-1  |     return func(request, *args, **kwargs)
lms-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lms-1  |   File "/openedx/edx-platform/common/djangoapps/student/views/dashboard.py", line 899, in student_dashboard
lms-1  |     response = render_to_response(dashboard_template, context)
lms-1  |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lms-1  |   File "/openedx/edx-platform/common/djangoapps/edxmako/shortcuts.py", line 188, in render_to_response
lms-1  |     return HttpResponse(render_to_string(template_name, dictionary, namespace, request), **kwargs)
lms-1  |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lms-1  |   File "/openedx/edx-platform/common/djangoapps/edxmako/shortcuts.py", line 178, in render_to_string
lms-1  |     return template.render(dictionary, request)
lms-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lms-1  |   File "/openedx/edx-platform/common/djangoapps/edxmako/template.py", line 82, in render
lms-1  |     return self.mako_template.render_unicode(**context_dictionary)
lms-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lms-1  |   File "/openedx/venv/lib/python3.11/site-packages/mako/template.py", line 443, in render_unicode
lms-1  |     return runtime._render(
lms-1  |            ^^^^^^^^^^^^^^^^
lms-1  |   File "/openedx/venv/lib/python3.11/site-packages/mako/runtime.py", line 874, in _render
lms-1  |     _render_context(
lms-1  |   File "/openedx/venv/lib/python3.11/site-packages/mako/runtime.py", line 916, in _render_context
lms-1  |     _exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
lms-1  |   File "/openedx/venv/lib/python3.11/site-packages/mako/runtime.py", line 943, in _exec_template
lms-1  |     callable_(context, *args, **kwargs)
lms-1  |   File "/tmp/mako_lms/1ff981c2157d500713c1ce6bf7fdbce2/main.html.py", line 378, in render_body
lms-1  |     runtime._include_file(context, (static.get_template_path('header.html')), _template_uri, online_help_token=online_help_token)
lms-1  |   File "/openedx/venv/lib/python3.11/site-packages/mako/runtime.py", line 793, in _include_file
lms-1  |     callable_(ctx, **kwargs)
lms-1  |   File "/tmp/mako_lms/1ff981c2157d500713c1ce6bf7fdbce2/header.html.py", line 34, in render_body
lms-1  |     runtime._include_file(context, (static.get_template_path(relative_path='header/header.html')), _template_uri, online_help_token=online_help_token)
lms-1  |   File "/openedx/venv/lib/python3.11/site-packages/mako/runtime.py", line 793, in _include_file
lms-1  |     callable_(ctx, **kwargs)
lms-1  |   File "/tmp/mako_lms/1ff981c2157d500713c1ce6bf7fdbce2/indigo/lms/templates/header/header.html.py", line 99, in render_body
lms-1  |     runtime._include_file(context, 'navbar-authenticated.html', _template_uri, online_help_token=online_help_token)
lms-1  |   File "/openedx/venv/lib/python3.11/site-packages/mako/runtime.py", line 793, in _include_file
lms-1  |     callable_(ctx, **kwargs)
lms-1  |   File "/tmp/mako_lms/1ff981c2157d500713c1ce6bf7fdbce2/indigo/lms/templates/header/navbar-authenticated.html.py", line 106, in render_body
lms-1  |     runtime._include_file(context, 'user_dropdown.html', _template_uri)
lms-1  |   File "/openedx/venv/lib/python3.11/site-packages/mako/runtime.py", line 780, in _include_file
lms-1  |     template = _lookup_template(context, uri, calling_uri)
lms-1  |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lms-1  |   File "/openedx/venv/lib/python3.11/site-packages/mako/runtime.py", line 837, in _lookup_template
lms-1  |     return lookup.get_template(uri)
lms-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^
lms-1  |   File "/openedx/edx-platform/common/djangoapps/edxmako/paths.py", line 99, in get_template
lms-1  |     template = super().get_template(get_template_path_with_theme(uri))
lms-1  |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lms-1  |   File "/openedx/venv/lib/python3.11/site-packages/mako/lookup.py", line 251, in get_template
lms-1  |     return self._load(srcfile, uri)
lms-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^
lms-1  |   File "/openedx/venv/lib/python3.11/site-packages/mako/lookup.py", line 312, in _load
lms-1  |     self._collection[uri] = template = Template(
lms-1  |                                        ^^^^^^^^^
lms-1  |   File "/openedx/venv/lib/python3.11/site-packages/mako/template.py", line 316, in __init__
lms-1  |     module = self._compile_from_file(path, filename)
lms-1  |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lms-1  |   File "/openedx/venv/lib/python3.11/site-packages/mako/template.py", line 380, in _compile_from_file
lms-1  |     module = compat.load_module(self.module_id, path)
lms-1  |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lms-1  |   File "/openedx/venv/lib/python3.11/site-packages/mako/compat.py", line 53, in load_module
lms-1  |     spec.loader.exec_module(module)
lms-1  |   File "<frozen importlib._bootstrap_external>", line 940, in exec_module
lms-1  |   File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
lms-1  |   File "/tmp/mako_lms/1ff981c2157d500713c1ce6bf7fdbce2/indigo/lms/templates/header/user_dropdown.html.py", line 24, in <module>
lms-1  |     from openedx.core.djangoapps.user_api.accounts.toggles import should_redirect_to_order_history_microfrontend
lms-1  | ModuleNotFoundError: No module named 'openedx.core.djangoapps.user_api.accounts.toggles'
@kdmccormick kdmccormick added the bug Something isn't working label Feb 14, 2025
@DawoudSheraz
Copy link
Contributor

Thanks @kdmccormick , we will take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: In review
Development

Successfully merging a pull request may close this issue.

3 participants