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
fdfc37e4
Commit
fdfc37e4
authored
Apr 14, 2013
by
ichuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
masquerade pep8
parent
af3e08e8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
lms/djangoapps/courseware/masquerade.py
+4
-3
No files found.
lms/djangoapps/courseware/masquerade.py
View file @
fdfc37e4
...
...
@@ -15,8 +15,9 @@ log = logging.getLogger(__name__)
MASQ_KEY
=
'masquerade_identity'
def
handle_ajax
(
request
,
marg
):
if
marg
==
'toggle'
:
if
marg
==
'toggle'
:
status
=
request
.
session
.
get
(
MASQ_KEY
,
''
)
if
status
is
None
or
status
in
[
''
,
'staff'
]:
status
=
'student'
...
...
@@ -37,7 +38,7 @@ def setup_masquerade(request, staff_access=False):
if
request
.
user
is
None
:
return
None
if
not
staff_access
:
# can masquerade only if user has staff access to course
if
not
staff_access
:
# can masquerade only if user has staff access to course
return
None
usertype
=
request
.
session
.
get
(
MASQ_KEY
,
''
)
...
...
@@ -45,7 +46,7 @@ def setup_masquerade(request, staff_access=False):
request
.
session
[
MASQ_KEY
]
=
'staff'
usertype
=
'staff'
if
usertype
==
'student'
:
if
usertype
==
'student'
:
request
.
user
.
masquerade_as_student
=
True
return
usertype
...
...
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