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
857a6e0b
Commit
857a6e0b
authored
Apr 14, 2013
by
ichuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pylint masquerade fixes
parent
fdfc37e4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
8 deletions
+12
-8
lms/djangoapps/courseware/access.py
+1
-1
lms/djangoapps/courseware/masquerade.py
+11
-7
No files found.
lms/djangoapps/courseware/access.py
View file @
857a6e0b
...
...
@@ -15,7 +15,7 @@ from xmodule.modulestore import Location
from
xmodule.x_module
import
XModule
,
XModuleDescriptor
from
student.models
import
CourseEnrollmentAllowed
from
masquerade
import
is_masquerading_as_student
from
courseware.
masquerade
import
is_masquerading_as_student
DEBUG_ACCESS
=
False
...
...
lms/djangoapps/courseware/masquerade.py
View file @
857a6e0b
#---------------------------------------- Masequerade ----------------------------------------
#
# Allow course staff to see a student or staff view of courseware.
# Which kind of view has been selected is stored in the session state.
'''
---------------------------------------- Masequerade ----------------------------------------
Allow course staff to see a student or staff view of courseware.
Which kind of view has been selected is stored in the session state.
'''
import
json
import
logging
from
django.conf
import
settings
from
django.contrib.auth.models
import
User
from
django.contrib.auth.decorators
import
login_required
from
django.http
import
HttpResponse
log
=
logging
.
getLogger
(
__name__
)
...
...
@@ -17,6 +15,9 @@ MASQ_KEY = 'masquerade_identity'
def
handle_ajax
(
request
,
marg
):
'''
Handle ajax call from "staff view" / "student view" toggle button
'''
if
marg
==
'toggle'
:
status
=
request
.
session
.
get
(
MASQ_KEY
,
''
)
if
status
is
None
or
status
in
[
''
,
'staff'
]:
...
...
@@ -53,5 +54,8 @@ def setup_masquerade(request, staff_access=False):
def
is_masquerading_as_student
(
user
):
'''
Return True if user is masquerading as a student, False otherwise
'''
masq
=
getattr
(
user
,
'masquerade_as_student'
,
False
)
return
masq
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