Skip to content

Bug: Missing average rating from course instructor card #1125

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

Merged
merged 1 commit into from
Jul 27, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions tcf_website/views/browse.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@

from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django.db.models import Avg, CharField, Count, F, Q, Value, Sum, Prefetch
from django.db.models.functions import Concat, Coalesce
from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator
from django.db.models import Avg, CharField, Count, F, Prefetch, Q, Sum, Value
from django.db.models.functions import Coalesce, Concat
from django.http import Http404
from django.shortcuts import get_object_or_404, redirect, render
from django.urls import reverse
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger

from ..models import (
Answer,
Expand Down Expand Up @@ -270,6 +270,8 @@ def course_view(
if num and times
}

instructor.rating = instructor.average_rating_for_course(course)

dept = course.subdepartment.department

# Navigation breadcrumbs
Expand Down
Loading