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
12ae70b0
Commit
12ae70b0
authored
May 16, 2014
by
Diana Huang
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3753 from edx/diana/update-forums-cmd
Update get_discussion_link command to use CourseKeys
parents
f3fb82f8
7a87179d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
lms/djangoapps/django_comment_client/management/commands/get_discussion_link.py
+9
-2
No files found.
lms/djangoapps/django_comment_client/management/commands/get_discussion_link.py
View file @
12ae70b0
from
django.core.management.base
import
BaseCommand
,
CommandError
from
opaque_keys
import
InvalidKeyError
from
xmodule.modulestore.keys
import
CourseKey
from
xmodule.modulestore.locations
import
SlashSeparatedCourseKey
from
courseware.courses
import
get_course
...
...
@@ -14,8 +17,12 @@ class Command(BaseCommand):
course_id
=
args
[
0
]
try
:
course
=
get_course
(
course_id
)
except
ValueError
:
course_key
=
CourseKey
.
from_string
(
course_id
)
except
InvalidKeyError
:
course_key
=
SlashSeparatedCourseKey
.
from_deprecated_string
(
course_id
)
course
=
get_course
(
course_key
)
if
not
course
:
raise
CommandError
(
"Invalid course id: {}"
.
format
(
course_id
))
if
course
.
discussion_link
:
...
...
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