Commit 0bf79eb5 by Chris Dodge

append some character, in this case a '_', if the course number is really a…

append some character, in this case a '_', if the course number is really a full-on number. The Wiki library interprets this incorrectly - to date we've always used non-numerical values.
parent 3ae08d10
......@@ -30,6 +30,19 @@ def course_wiki_redirect(request, course_id):
course = get_course_by_id(course_id)
course_slug = course.wiki_slug
# cdodge: fix for cases where self.location.course can be interpreted as an number rather than
# a string. We're seeing in Studio created courses that people often will enter in a stright number
# for 'course' (e.g. 201). This Wiki library expects a string to "do the right thing". We haven't noticed this before
# because - to now - 'course' has always had non-numeric characters in them
try:
float(course_slug)
# if the float() doesn't throw an exception, that means it's a number
course_slug = course_slug + "_"
except:
pass
valid_slug = True
if not course_slug:
......
Markdown is supported
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