openedx / edx-platform

The Open edX LMS & Studio, powering education sites around the world!
https://openedx.org
GNU Affero General Public License v3.0
7.09k stars 3.78k forks source link

Dismiss for Discussions x-blocks deprecation banner in Studio causes 500 error message #34483

Open DmytroAlipov opened 2 months ago

DmytroAlipov commented 2 months ago
edx.cms  | 2024-04-08 09:42:28,266 ERROR 32 [django.request] [user None] [ip None] log.py:241 - Internal Server Error: /course/course-v1:RG+New-course-2+2024
edx.cms  | Traceback (most recent call last):
edx.cms  |   File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/django/core/handlers/exception.py", line 55, in inner
edx.cms  |     response = get_response(request)
edx.cms  |   File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/django/core/handlers/base.py", line 197, in _get_response
edx.cms  |     response = wrapped_callback(request, *callback_args, **callback_kwargs)
edx.cms  |   File "/usr/lib/python3.8/contextlib.py", line 75, in inner
edx.cms  |     return func(*args, **kwds)
edx.cms  |   File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/django/contrib/auth/decorators.py", line 23, in _wrapper_view
edx.cms  |     return view_func(request, *args, **kwargs)
edx.cms  |   File "/edx/app/edxapp/edx-platform/cms/djangoapps/contentstore/views/course.py", line 301, in course_handler
edx.cms  |     raise NotImplementedError()
edx.cms  | NotImplementedError
edx.cms  | [08/Apr/2024 09:42:28] "DELETE /course/course-v1:RG+New-course-2+2024 HTTP/1.1" 500 245031

This error concerns the Dismiss button:

Знімок екрана 2024-04-08 о 13 41 21

This error occurs here:

elif request.method == 'DELETE':
    raise NotImplementedError()

This banner was added in this MR. But the backend part was not prepared for this at all.

Hello, @muhammadadeeltajamul, You have been working on this task. Can you tell me if there are plans to continue this work? Would it be possible to add a variable to control the display of the banner? It could help manage user preferences or control this content. As I understand it, in the current implementation the Dismiss button is not needed at all.

qasimgulzar commented 2 months ago

Hey @DmytroAlipov I was looking into this issue, but unable to understand the relation between this Warning popup and the code you have linked. I tried to reproduce this issue but nothing happens even it didn't sent out any request to the studio/lms server.

https://drive.google.com/file/d/1kXSheo-WHtzBVPJsV7rBh906z4Z5HCLS/view?usp=sharing

DmytroAlipov commented 2 months ago

Hi @qasimgulzar But if you reload the page, the banner will be displayed again.

qasimgulzar commented 2 months ago

@DmytroAlipov can we find the original issue under which this banner was added, so we can better understand the intention. You are right on refresh it appears again.

Note: We have notifications in openedx to maintain user specific state of the notification. Ideal that would have to be reused here. I can take care of it you are think the same?

DmytroAlipov commented 2 months ago

In my opinion, it is best to do as it is implemented for this banner. Here, when you click Dismiss, the backend works.

dissm

After the Dismiss button for the top banner is pressed, this top banner no longer appears after the page reloads