Skip to content

Commit

Permalink
add a method to the CCXBlockUsageLocator class that will return a n…
Browse files Browse the repository at this point in the history
…ormal BlockUsageLocator. In keeping with the idea of a 'neutral' or 'course-local' version of ccx keys
  • Loading branch information
cewing committed Jun 1, 2015
1 parent 81d071a commit e6b0370
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ccx_keys/locator.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,13 @@ def ccx(self):
"""Returns the ccx for this object's course_key."""
return self.course_key.ccx

def to_block_locator(self):
return BlockUsageLocator(
course_key=self.course_key.to_course_locator(),
block_type=self.block_type,
block_id=self.block_id
)

def _to_deprecated_string(self):
""" CCXBlockUsageLocators are never deprecated. """
raise NotImplementedError
Expand Down

0 comments on commit e6b0370

Please sign in to comment.