Commit c9285de4 by Don Mitchell

unicode correctly and understandably

parent ca0dd839
...@@ -204,16 +204,14 @@ class CourseLocator(Locator): ...@@ -204,16 +204,14 @@ class CourseLocator(Locator):
""" """
Return a string representing this location. Return a string representing this location.
""" """
result = u"" parts = []
if self.package_id: if self.package_id:
result += unicode(self.package_id) parts.append(unicode(self.package_id))
if self.branch: if self.branch:
result += '/' + BRANCH_PREFIX + self.branch parts.append(u"{prefix}{branch}".format(prefix=BRANCH_PREFIX, branch=self.branch))
if self.version_guid: if self.version_guid:
if self.package_id: parts.append(u"{prefix}{guid}".format(prefix=VERSION_PREFIX, guid=self.version_guid))
result += u"/" return u"/".join(parts)
result += u"{prefix}{guid}".format(prefix=VERSION_PREFIX, guid=self.version_guid)
return result
def url(self): def url(self):
""" """
......
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