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
8f90dd83
Commit
8f90dd83
authored
May 09, 2014
by
Greg Price
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3653 from edx/gprice/discussion-link-command
Add command to get discussion_link for a course
parents
f4d97ca5
5e849bfb
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
lms/djangoapps/django_comment_client/management/commands/get_discussion_link.py
+22
-0
No files found.
lms/djangoapps/django_comment_client/management/commands/get_discussion_link.py
0 → 100644
View file @
8f90dd83
from
django.core.management.base
import
BaseCommand
,
CommandError
from
courseware.courses
import
get_course
class
Command
(
BaseCommand
):
args
=
"<course_id>"
def
handle
(
self
,
*
args
,
**
options
):
if
not
args
:
raise
CommandError
(
"Course id not specified"
)
if
len
(
args
)
>
1
:
raise
CommandError
(
"Only one course id may be specifiied"
)
course_id
=
args
[
0
]
try
:
course
=
get_course
(
course_id
)
except
ValueError
:
raise
CommandError
(
"Invalid course id: {}"
.
format
(
course_id
))
if
course
.
discussion_link
:
self
.
stdout
.
write
(
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