Change str conversion to text_type.

This commit is contained in:
John Eskew
2018-01-11 11:24:14 -05:00
committed by Troy Sankey
parent 3915c47d71
commit 2eab707cc0

View File

@@ -2,6 +2,7 @@
Course Goals Python API
"""
import models
from six import text_type
from opaque_keys.edx.keys import CourseKey
from django.conf import settings
@@ -22,7 +23,7 @@ def add_course_goal(user, course_id, goal_key):
goal_key (string): The goal key for the new goal.
"""
course_key = CourseKey.from_string(str(course_id))
course_key = CourseKey.from_string(text_type(course_id))
current_goal = get_course_goal(user, course_key)
if current_goal:
# If a course goal already exists, simply update it.