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
630607d3
Commit
630607d3
authored
Feb 05, 2013
by
ichuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix forum management commands (assign_default_role moved); add reload_forum_users
parent
82afc477
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
2 deletions
+34
-2
lms/djangoapps/django_comment_client/management/commands/assign_roles_for_course.py
+2
-1
lms/djangoapps/django_comment_client/management/commands/create_roles_for_existing.py
+2
-1
lms/djangoapps/django_comment_client/management/commands/reload_forum_users.py
+30
-0
No files found.
lms/djangoapps/django_comment_client/management/commands/assign_roles_for_course.py
View file @
630607d3
...
...
@@ -6,7 +6,8 @@ Enrollments.
"""
from
django.core.management.base
import
BaseCommand
,
CommandError
from
student.models
import
CourseEnrollment
,
assign_default_role
from
student.models
import
CourseEnrollment
from
django_comment_client.models
import
assign_default_role
class
Command
(
BaseCommand
):
args
=
'course_id'
...
...
lms/djangoapps/django_comment_client/management/commands/create_roles_for_existing.py
View file @
630607d3
...
...
@@ -6,7 +6,8 @@ Enrollments.
"""
from
django.core.management.base
import
BaseCommand
,
CommandError
from
student.models
import
CourseEnrollment
,
assign_default_role
from
student.models
import
CourseEnrollment
from
django_comment_client.models
import
assign_default_role
class
Command
(
BaseCommand
):
args
=
'course_id'
...
...
lms/djangoapps/django_comment_client/management/commands/reload_forum_users.py
0 → 100644
View file @
630607d3
"""
Reload forum (comment client) users from existing users.
"""
from
django.core.management.base
import
BaseCommand
,
CommandError
from
django.contrib.auth.models
import
User
import
comment_client
as
cc
class
Command
(
BaseCommand
):
help
=
'Reload forum (comment client) users from existing users'
def
adduser
(
self
,
user
):
print
user
try
:
cc_user
=
cc
.
User
.
from_django_user
(
user
)
cc_user
.
save
()
except
Exception
as
err
:
print
"update user info to discussion failed for user with id:
%
s"
%
user
def
handle
(
self
,
*
args
,
**
options
):
if
len
(
args
)
!=
0
:
uset
=
[
User
.
objects
.
get
(
username
=
x
)
for
x
in
args
]
else
:
uset
=
User
.
objects
.
all
()
for
user
in
uset
:
self
.
adduser
(
user
)
\ No newline at end of file
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