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
37f84894
Commit
37f84894
authored
Jan 10, 2013
by
ichuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
only is_staff users can add/edit/delete course instructors
parent
5cc88ec1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
lms/djangoapps/instructor/views.py
+3
-3
No files found.
lms/djangoapps/instructor/views.py
View file @
37f84894
...
@@ -245,7 +245,7 @@ def instructor_dashboard(request, course_id):
...
@@ -245,7 +245,7 @@ def instructor_dashboard(request, course_id):
datatable
[
'title'
]
=
'List of Staff in course {0}'
.
format
(
course_id
)
datatable
[
'title'
]
=
'List of Staff in course {0}'
.
format
(
course_id
)
track
.
views
.
server_track
(
request
,
'list-staff'
,
{},
page
=
'idashboard'
)
track
.
views
.
server_track
(
request
,
'list-staff'
,
{},
page
=
'idashboard'
)
elif
'List course instructors'
in
action
:
elif
'List course instructors'
in
action
and
request
.
user
.
is_staff
:
group
=
get_instructor_group
(
course
)
group
=
get_instructor_group
(
course
)
msg
+=
'Instructor group = {0}'
.
format
(
group
.
name
)
msg
+=
'Instructor group = {0}'
.
format
(
group
.
name
)
log
.
debug
(
'instructor grp={0}'
.
format
(
group
.
name
))
log
.
debug
(
'instructor grp={0}'
.
format
(
group
.
name
))
...
@@ -269,7 +269,7 @@ def instructor_dashboard(request, course_id):
...
@@ -269,7 +269,7 @@ def instructor_dashboard(request, course_id):
user
.
groups
.
add
(
group
)
user
.
groups
.
add
(
group
)
track
.
views
.
server_track
(
request
,
'add-staff {0}'
.
format
(
user
),
{},
page
=
'idashboard'
)
track
.
views
.
server_track
(
request
,
'add-staff {0}'
.
format
(
user
),
{},
page
=
'idashboard'
)
elif
action
==
'Add instructor'
:
elif
action
==
'Add instructor'
and
request
.
user
.
is_staff
:
uname
=
request
.
POST
[
'instructor'
]
uname
=
request
.
POST
[
'instructor'
]
try
:
try
:
user
=
User
.
objects
.
get
(
username
=
uname
)
user
=
User
.
objects
.
get
(
username
=
uname
)
...
@@ -297,7 +297,7 @@ def instructor_dashboard(request, course_id):
...
@@ -297,7 +297,7 @@ def instructor_dashboard(request, course_id):
user
.
groups
.
remove
(
group
)
user
.
groups
.
remove
(
group
)
track
.
views
.
server_track
(
request
,
'remove-staff {0}'
.
format
(
user
),
{},
page
=
'idashboard'
)
track
.
views
.
server_track
(
request
,
'remove-staff {0}'
.
format
(
user
),
{},
page
=
'idashboard'
)
elif
action
==
'Remove instructor'
:
elif
action
==
'Remove instructor'
and
request
.
user
.
is_staff
:
uname
=
request
.
POST
[
'instructor'
]
uname
=
request
.
POST
[
'instructor'
]
try
:
try
:
user
=
User
.
objects
.
get
(
username
=
uname
)
user
=
User
.
objects
.
get
(
username
=
uname
)
...
...
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