Skip to content
Snippets Groups Projects
Unverified Commit e1a3d661 authored by Ned Batchelder's avatar Ned Batchelder Committed by GitHub
Browse files

Merge pull request #21220 from eduNEXT/coa/course-index-regex

Making the regex that gets the index courses more secure
parents 41c39249 0dcb6ece
No related merge requests found
......@@ -603,7 +603,7 @@ class CourseOverview(TimeStampedModel):
# In rare cases, courses belonging to the same org may be accidentally assigned
# an org code with a different casing (e.g., Harvardx as opposed to HarvardX).
# Case-insensitive matching allows us to deal with this kind of dirty data.
course_overviews = course_overviews.filter(org__iregex=r'(' + '|'.join(orgs) + ')')
course_overviews = course_overviews.filter(org__iregex=r'(^' + '$|^'.join(orgs) + '$)')
if filter_:
course_overviews = course_overviews.filter(**filter_)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment