frappe / lms

Easy to Use, 100% Open Source Learning Management System
https://frappe.io/learning
GNU Affero General Public License v3.0
1.08k stars 490 forks source link

Can't create new course from lms workspace #804

Open Dheemant6 opened 6 months ago

Dheemant6 commented 6 months ago

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

pateljannat commented 6 months ago

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

ptminh-kmp commented 6 months ago

@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 commented 5 months ago

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

BunnyMan1 commented 5 months ago

@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 commented 5 months ago

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 commented 5 months ago

@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 commented 5 months ago

@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 commented 5 months ago

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

haseebbasra commented 4 months ago

I am on develop branch, and have the latest code

pateljannat commented 3 months ago

This should be fixed now. @haseebbasra can you please confirm

haseebbasra commented 3 months ago

@pateljannat

It's fixed.

Thanks