From f93b2da0f530c4a5ab123b1746ea870f3478cb0f Mon Sep 17 00:00:00 2001 From: Muhammad Faraz Maqsood Date: Mon, 11 Dec 2023 16:16:45 +0500 Subject: [PATCH] fix 500 internal server error on ecommerce admin. Close #59. This error was occuring due to lms_user_id not_found. Requests that are sent to Ecommerce are expected to include the LMS user id. If they do not include the id, the creator of the request is responsible for ensuring that Ecommerce already knows the LMS user id for the user. Requests to Ecommerce will be rejected and a MissingLmsUserIdException will be raised if Ecommerce cannot find a LMS user id for the affected user(s), unless the allow_missing_lms_user_id waffle switch is enabled. --- ...fix_500_internal_server_error_due_to_lms_user_id_not_found.md | 1 + tutorecommerce/templates/ecommerce/tasks/ecommerce/init | 1 + 2 files changed, 2 insertions(+) create mode 100644 changelog.d/20231211_161222_faraz.maqsood_faraz_fix_500_internal_server_error_due_to_lms_user_id_not_found.md diff --git a/changelog.d/20231211_161222_faraz.maqsood_faraz_fix_500_internal_server_error_due_to_lms_user_id_not_found.md b/changelog.d/20231211_161222_faraz.maqsood_faraz_fix_500_internal_server_error_due_to_lms_user_id_not_found.md new file mode 100644 index 00000000..357c785f --- /dev/null +++ b/changelog.d/20231211_161222_faraz.maqsood_faraz_fix_500_internal_server_error_due_to_lms_user_id_not_found.md @@ -0,0 +1 @@ +- [Bugfix] Fix 500 internal server error due to lms_user_id not found on accessing the ecommerce admin panel. (by @Faraz32123) \ No newline at end of file diff --git a/tutorecommerce/templates/ecommerce/tasks/ecommerce/init b/tutorecommerce/templates/ecommerce/tasks/ecommerce/init index 890b73c3..3e36096c 100644 --- a/tutorecommerce/templates/ecommerce/tasks/ecommerce/init +++ b/tutorecommerce/templates/ecommerce/tasks/ecommerce/init @@ -1,5 +1,6 @@ ./manage.py migrate --noinput ./manage.py oscar_populate_countries --initial-only +./manage.py waffle_switch allow_missing_lms_user_id on --create {% for app_name, app in iter_mfes() %} {% if app_name == "payment" %}