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
e18507f1
Commit
e18507f1
authored
Jan 28, 2014
by
David Baumgold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix pep8/pylint issues
parent
692502c0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
6 deletions
+16
-6
cms/djangoapps/contentstore/management/commands/migrate_to_split.py
+5
-3
cms/djangoapps/contentstore/management/commands/tests/test_delete_split_course.py
+4
-0
cms/djangoapps/contentstore/management/commands/tests/test_migrate_to_split.py
+4
-0
common/lib/xmodule/xmodule/modulestore/tests/django_utils.py
+3
-3
No files found.
cms/djangoapps/contentstore/management/commands/migrate_to_split.py
View file @
e18507f1
...
...
@@ -11,7 +11,7 @@ from xmodule.modulestore import InvalidLocationError
from
xmodule.modulestore.django
import
loc_mapper
def
user_from_str
(
s
):
def
user_from_str
(
identifier
):
"""
Return a user identified by the given string. The string could be an email
address, or a stringified integer corresponding to the ID of the user in
...
...
@@ -19,14 +19,16 @@ def user_from_str(s):
will be raised.
"""
try
:
user_id
=
int
(
s
)
user_id
=
int
(
identifier
)
except
ValueError
:
return
User
.
objects
.
get
(
email
=
s
)
return
User
.
objects
.
get
(
email
=
identifier
)
else
:
return
User
.
objects
.
get
(
id
=
user_id
)
class
Command
(
BaseCommand
):
"Migrate a course from old-Mongo to split-Mongo"
help
=
"Migrate a course from old-Mongo to split-Mongo"
args
=
"location email <locator>"
...
...
cms/djangoapps/contentstore/management/commands/tests/test_delete_split_course.py
View file @
e18507f1
...
...
@@ -11,9 +11,13 @@ from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from
xmodule.modulestore.tests.persistent_factories
import
PersistentCourseFactory
from
xmodule.modulestore.django
import
modulestore
from
xmodule.modulestore.exceptions
import
ItemNotFoundError
# pylint: disable=E1101
class
TestArgParsing
(
unittest
.
TestCase
):
"""
Tests for parsing arguments for the `delete_split_course` management command
"""
def
setUp
(
self
):
self
.
command
=
Command
()
...
...
cms/djangoapps/contentstore/management/commands/tests/test_migrate_to_split.py
View file @
e18507f1
...
...
@@ -12,9 +12,13 @@ from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from
xmodule.modulestore.tests.factories
import
CourseFactory
from
xmodule.modulestore.django
import
modulestore
from
xmodule.modulestore.django
import
loc_mapper
# pylint: disable=E1101
class
TestArgParsing
(
unittest
.
TestCase
):
"""
Tests for parsing arguments for the `migrate_to_split` management command
"""
def
setUp
(
self
):
self
.
command
=
Command
()
...
...
common/lib/xmodule/xmodule/modulestore/tests/django_utils.py
View file @
e18507f1
...
...
@@ -225,9 +225,9 @@ class ModuleStoreTestCase(TestCase):
if
contentstore
()
.
fs_files
:
db
=
contentstore
()
.
fs_files
.
database
db
.
connection
.
drop_database
(
db
)
l
m
=
loc_mapper
()
if
l
m
.
db
:
l
m
.
location_map
.
drop
()
l
ocation_mapper
=
loc_mapper
()
if
l
ocation_mapper
.
db
:
l
ocation_mapper
.
location_map
.
drop
()
@classmethod
def
setUpClass
(
cls
):
...
...
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