From 4c2e612aeb34f910d484b53894b888b9c1042f09 Mon Sep 17 00:00:00 2001 From: Calen Pennington Date: Wed, 21 May 2014 14:43:51 -0400 Subject: [PATCH] Make mongoengine field for UsageKeys expect a Location --- common/lib/xmodule/xmodule/modulestore/mongoengine_fields.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/lib/xmodule/xmodule/modulestore/mongoengine_fields.py b/common/lib/xmodule/xmodule/modulestore/mongoengine_fields.py index 16bcff3ed4..59953192eb 100644 --- a/common/lib/xmodule/xmodule/modulestore/mongoengine_fields.py +++ b/common/lib/xmodule/xmodule/modulestore/mongoengine_fields.py @@ -59,9 +59,9 @@ class UsageKeyField(mongoengine.StringField): """ For now saves the usage key in the deprecated location i4x/c4x form """ - assert isinstance(location, (NoneType, SlashSeparatedCourseKey)) + assert isinstance(location, (NoneType, Location)) if location is None: - return location + return None return super(UsageKeyField, self).to_mongo(location.to_deprecated_string()) def to_python(self, location):