Skip to content

Commit

Permalink
Hotfix: Don't sort students by period
Browse files Browse the repository at this point in the history
Sorting by period (a ManyToManyField) results in duplicate student entries
  • Loading branch information
krishnans2006 committed Jan 8, 2025
1 parent f409b0f commit f61e2ef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tin/apps/assignments/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def show_view(request, assignment_id):
if query:
active_period = "query"
student_list = course.students.filter(full_name__icontains=query).order_by(
"periods", "last_name", "first_name"
"last_name", "first_name"
)
elif course.period_set.exists():
if period == "":
Expand All @@ -104,7 +104,7 @@ def show_view(request, assignment_id):

if period == "all":
active_period = "all"
student_list = course.students.all().order_by("periods", "last_name", "first_name")
student_list = course.students.all().order_by("last_name", "first_name")
elif period == "none":
active_period = "none"
student_list = []
Expand Down

0 comments on commit f61e2ef

Please sign in to comment.