From 87688af610665417774da4e364a8698e01fa4858 Mon Sep 17 00:00:00 2001 From: Muhammad Faraz Maqsood Date: Thu, 3 Apr 2025 16:21:45 +0500 Subject: [PATCH 1/2] fix: move links with 500 status to forbidden links move links with 500 status_code to external forbidden links category for manual checking --- cms/djangoapps/contentstore/tasks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cms/djangoapps/contentstore/tasks.py b/cms/djangoapps/contentstore/tasks.py index fc588065cf..e36a8edae8 100644 --- a/cms/djangoapps/contentstore/tasks.py +++ b/cms/djangoapps/contentstore/tasks.py @@ -1375,7 +1375,7 @@ def _filter_by_status(results): continue elif status == 403 and _is_studio_url(url): filtered_results.append([block_id, url, LinkState.LOCKED]) - elif status in [403, None] and not _is_studio_url(url): + elif status in [403, 500, None] and not _is_studio_url(url): filtered_results.append([block_id, url, LinkState.EXTERNAL_FORBIDDEN]) else: filtered_results.append([block_id, url, LinkState.BROKEN]) From bf2959e8fc8a36575717d27ca48debb0fc193fa1 Mon Sep 17 00:00:00 2001 From: Hassan Raza Date: Fri, 4 Apr 2025 15:32:45 +0500 Subject: [PATCH 2/2] fix: Optimize queries for Course Notification Preferences Admin (#36479) --- openedx/core/djangoapps/notifications/admin.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/openedx/core/djangoapps/notifications/admin.py b/openedx/core/djangoapps/notifications/admin.py index 82524e4b08..a57d3458e9 100644 --- a/openedx/core/djangoapps/notifications/admin.py +++ b/openedx/core/djangoapps/notifications/admin.py @@ -82,6 +82,10 @@ class CourseNotificationPreferenceAdmin(admin.ModelAdmin): def get_username(self, obj): return obj.user.username + def get_queryset(self, request): + queryset = super().get_queryset(request) + return queryset.select_related("user").only("id", "user__username", "course_id") + def get_search_results(self, request, queryset, search_term): """ Custom search for CourseNotificationPreference model