From 3bbdd2f4c3b2834b83507dd15e9891606659b96d Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Wed, 2 Oct 2013 10:35:58 -0400 Subject: [PATCH] No need to invoke classmethods through self.__class__ --- common/lib/xmodule/xmodule/xml_module.py | 4 ++-- lms/lib/comment_client/models.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/common/lib/xmodule/xmodule/xml_module.py b/common/lib/xmodule/xmodule/xml_module.py index b555d8f775..c64f1e0be3 100644 --- a/common/lib/xmodule/xmodule/xml_module.py +++ b/common/lib/xmodule/xmodule/xml_module.py @@ -378,7 +378,7 @@ class XmlDescriptor(XModuleDescriptor): # Get the definition xml_object = self.definition_to_xml(resource_fs) - self.__class__.clean_metadata_from_xml(xml_object) + self.clean_metadata_from_xml(xml_object) # Set the tag so we get the file path right xml_object.tag = self.category @@ -401,7 +401,7 @@ class XmlDescriptor(XModuleDescriptor): if self.export_to_file(): # Write the definition to a file url_path = name_to_pathname(self.url_name) - filepath = self.__class__._format_filepath(self.category, url_path) + filepath = self._format_filepath(self.category, url_path) resource_fs.makedir(os.path.dirname(filepath), recursive=True, allow_recreate=True) with resource_fs.open(filepath, 'w') as file: file.write(etree.tostring(xml_object, pretty_print=True, encoding='utf-8')) diff --git a/lms/lib/comment_client/models.py b/lms/lib/comment_client/models.py index bf5f576a44..97734c36e8 100644 --- a/lms/lib/comment_client/models.py +++ b/lms/lib/comment_client/models.py @@ -91,7 +91,7 @@ class Model(object): pass def save(self): - self.__class__.before_save(self) + self.before_save(self) if self.id: # if we have id already, treat this as an update url = self.url(action='put', params=self.attributes) response = perform_request('put', url, self.updatable_attributes()) @@ -100,7 +100,7 @@ class Model(object): response = perform_request('post', url, self.initializable_attributes()) self.retrieved = True self.update_attributes(**response) - self.__class__.after_save(self) + self.after_save(self) def delete(self): url = self.url(action='delete', params=self.attributes)