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

Can't create new course from lms workspace #804

Open
Dheemant6 opened this issue May 8, 2024 · 8 comments
Open

Can't create new course from lms workspace #804

Dheemant6 opened this issue May 8, 2024 · 8 comments
Labels
bug Something isn't working

Comments

@Dheemant6
Copy link

Traceback (most recent call last):
File "apps/frappe/frappe/website/serve.py", line 20, in get_response
response = renderer_instance.render()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/website/page_renderers/template_page.py", line 84, in render
html = self.get_html()
^^^^^^^^^^^^^^^
File "apps/frappe/frappe/website/utils.py", line 521, in cache_html_decorator
html = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/website/page_renderers/template_page.py", line 95, in get_html
self.update_context()
File "apps/frappe/frappe/website/page_renderers/template_page.py", line 163, in update_context
data = self.run_pymodule_method("get_context")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/website/page_renderers/template_page.py", line 223, in run_pymodule_method
return method(self.context)
^^^^^^^^^^^^^^^^^^^^
File "apps/lms/lms/www/certificate.py", line 11, in get_context
template = quote(template)
^^^^^^^^^^^^^^^
File "/home/frappe/.pyenv/versions/3.11.6/lib/python3.11/urllib/parse.py", line 893, in quote
return quote_from_bytes(string, safe)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/frappe/.pyenv/versions/3.11.6/lib/python3.11/urllib/parse.py", line 923, in quote_from_bytes
raise TypeError("quote_from_bytes() expected bytes")
TypeError: quote_from_bytes() expected bytes

getting this error. anyone help me with this

@Dheemant6 Dheemant6 added the bug Something isn't working label May 8, 2024
@pateljannat
Copy link
Collaborator

@Dheemant6 please help me with the steps to replicate this error

@ptminh-kmp
Copy link

@Dheemant6 please help me with the steps to replicate this error

I got this error too. I was following there steps:

  1. Run bench get-app lms
  2. Run bench --site [My Site] install-app lms
  3. Locate to LMS Dashboard > Create a Course, and got this error:
    Traceback (most recent call last):
    File "apps/frappe/frappe/website/serve.py", line 18, in get_response
    response = renderer_instance.render()
    File "apps/frappe/frappe/website/page_renderers/template_page.py", line 84, in render
    html = self.get_html()
    File "apps/frappe/frappe/website/utils.py", line 523, in cache_html_decorator
    html = func(*args, **kwargs)
    File "apps/frappe/frappe/website/page_renderers/template_page.py", line 95, in get_html
    self.update_context()
    File "apps/frappe/frappe/website/page_renderers/template_page.py", line 163, in update_context
    data = self.run_pymodule_method("get_context")
    File "apps/frappe/frappe/website/page_renderers/template_page.py", line 223, in run_pymodule_method
    return method(self.context)
    File "apps/lms/lms/www/certificate.py", line 11, in get_context
    template = quote(template)
    File "/usr/lib/python3.10/urllib/parse.py", line 881, in quote
    return quote_from_bytes(string, safe)
    File "/usr/lib/python3.10/urllib/parse.py", line 906, in quote_from_bytes
    raise TypeError("quote_from_bytes() expected bytes")
    TypeError: quote_from_bytes() expected bytes

@pateljannat
Copy link
Collaborator

@Dheemant6 @ptminh-kmp what version of frappe and learning are you on?

@BunnyMan1
Copy link

@pateljannat I faced the same issue. My version is from the docker command on the readme from 3-4 days ago:

git clone https://github.com/frappe/lms
cd apps/lms/docker
docker-compose up

@haseebbasra
Copy link

haseebbasra commented Jun 27, 2024

Hello @pateljannat @NagariaHussain

I'm encountering the same issue. When I click on the "Create a course" link in Desk at http://lms.local:8000/app/lms, it redirects to http://lms.local:8000/courses/new-course/edit, which appears incorrect.

However, I can edit courses directly from the course portal using this link: http://lms.local:8000/lms/courses/new/edit.

It seems that the link generated from Desk is incorrect and results in the following error.

Frappe Framework: v15.x.x-develop () (develop)
Frappe LMS: v1.0.0 (develop)

Traceback (most recent call last):
File "apps/frappe/frappe/website/serve.py", line 20, in get_response
response = renderer_instance.render()
File "apps/frappe/frappe/website/page_renderers/template_page.py", line 84, in render
html = self.get_html()
File "apps/frappe/frappe/website/utils.py", line 521, in cache_html_decorator
html = func(*args, **kwargs)
File "apps/frappe/frappe/website/page_renderers/template_page.py", line 95, in get_html
self.update_context()
File "apps/frappe/frappe/website/page_renderers/template_page.py", line 163, in update_context
data = self.run_pymodule_method("get_context")
File "apps/frappe/frappe/website/page_renderers/template_page.py", line 223, in run_pymodule_method
return method(self.context)
File "apps/lms/lms/www/certificate.py", line 11, in get_context
template = quote(template)
File "/usr/lib/python3.10/urllib/parse.py", line 881, in quote
return quote_from_bytes(string, safe)
File "/usr/lib/python3.10/urllib/parse.py", line 906, in quote_from_bytes
raise TypeError("quote_from_bytes() expected bytes")
TypeError: quote_from_bytes() expected bytes

@pateljannat
Copy link
Collaborator

@haseebbasra I have fixed the links with #900

However, from the traceback, it seems that your site os referring to an older file that no longer exists in the new version. I think you should try running the command bench build to rebuild all the assets and try accessing the portal after that. Let me know if the issue still persists.

@haseebbasra
Copy link

@pateljannat

I used the command bench build to build the assets, and the command completed successfully.

But unfortunately, the link in Desk is still same i.e Create a course button links here: http://lms.local:8000/courses/new-course/edit

@pateljannat
Copy link
Collaborator

Did you take the latest pull of develop branch? @haseebbasra

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
None yet
Development

No branches or pull requests

5 participants