Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
3bbdd2f4
Commit
3bbdd2f4
authored
Oct 02, 2013
by
Ned Batchelder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
No need to invoke classmethods through self.__class__
parent
a3525875
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
common/lib/xmodule/xmodule/xml_module.py
+2
-2
lms/lib/comment_client/models.py
+2
-2
No files found.
common/lib/xmodule/xmodule/xml_module.py
View file @
3bbdd2f4
...
...
@@ -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'
))
...
...
lms/lib/comment_client/models.py
View file @
3bbdd2f4
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment