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]) 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