diff --git a/common/lib/xmodule/xmodule/video_module.py b/common/lib/xmodule/xmodule/video_module.py index 805ca48930..7830ff77b4 100644 --- a/common/lib/xmodule/xmodule/video_module.py +++ b/common/lib/xmodule/xmodule/video_module.py @@ -215,10 +215,6 @@ class VideoDescriptor(VideoFields, TabsEditingDescriptor, EmptyDataRawDescriptor self._model_data.update(model_data) del self.data - # I'm not sure how, but in some lifecycles we can loose the .category attribute - # this needs to be investigated - self.category = 'video' - @classmethod def from_xml(cls, xml_data, system, org=None, course=None): """ diff --git a/common/lib/xmodule/xmodule/x_module.py b/common/lib/xmodule/xmodule/x_module.py index 3556f3f0f3..4b22ae9fe2 100644 --- a/common/lib/xmodule/xmodule/x_module.py +++ b/common/lib/xmodule/xmodule/x_module.py @@ -467,11 +467,11 @@ class XModuleDescriptor(XModuleFields, HTMLSnippet, ResourceTemplates, XBlock): self.system = self.runtime if isinstance(self.location, Location): self.url_name = self.location.name - if not hasattr(self, 'category'): + if getattr(self, 'category', None) is None: self.category = self.location.category elif isinstance(self.location, BlockUsageLocator): self.url_name = self.location.usage_id - if not hasattr(self, 'category'): + if getattr(self, 'category', None) is None: raise InsufficientSpecificationError() else: raise InsufficientSpecificationError()