unicode fixes

This commit is contained in:
Abdallah
2014-04-02 16:18:56 +03:00
parent 1bd0bcb8c0
commit bb9f720fa6
4 changed files with 6 additions and 7 deletions

View File

@@ -82,8 +82,8 @@ def anonymous_id_for_user(user, course_id):
# include the secret key as a salt, and to make the ids unique across different LMS installs.
hasher = hashlib.md5()
hasher.update(settings.SECRET_KEY)
hasher.update(str(user.id))
hasher.update(course_id)
hasher.update(unicode(user.id))
hasher.update(course_id.encode('utf-8'))
digest = hasher.hexdigest()
try: