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
4ff2de69
Commit
4ff2de69
authored
Jun 28, 2013
by
Ned Batchelder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pylint fixes
parent
25d0f4d5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
4 deletions
+11
-4
lms/djangoapps/staticbook/tests.py
+4
-4
lms/djangoapps/staticbook/views.py
+7
-0
No files found.
lms/djangoapps/staticbook/tests.py
View file @
4ff2de69
...
...
@@ -7,7 +7,7 @@ from django.core.urlresolvers import reverse
from
courseware.tests.tests
import
TEST_DATA_MONGO_MODULESTORE
from
student.tests.factories
import
UserFactory
,
CourseEnrollmentFactory
from
xmodule.modulestore.tests.factories
import
CourseFactory
,
ItemFactory
from
xmodule.modulestore.tests.factories
import
CourseFactory
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
...
...
@@ -40,9 +40,9 @@ class StaticBookTest(ModuleStoreTestCase):
Make a course with an enrolled logged-in student.
"""
course
=
CourseFactory
.
create
(
**
kwargs
)
self
.
user
=
UserFactory
.
create
()
CourseEnrollmentFactory
.
create
(
user
=
self
.
user
,
course_id
=
course
.
id
)
self
.
client
.
login
(
username
=
self
.
user
.
username
,
password
=
'test'
)
user
=
UserFactory
.
create
()
CourseEnrollmentFactory
.
create
(
user
=
user
,
course_id
=
course
.
id
)
self
.
client
.
login
(
username
=
user
.
username
,
password
=
'test'
)
return
course
...
...
lms/djangoapps/staticbook/views.py
View file @
4ff2de69
"""
Views for serving static textbooks.
"""
from
django.contrib.auth.decorators
import
login_required
from
django.http
import
Http404
from
mitxmako.shortcuts
import
render_to_response
...
...
@@ -10,6 +14,9 @@ from static_replace import replace_static_urls
@login_required
def
index
(
request
,
course_id
,
book_index
,
page
=
None
):
"""
Serve static image-based textbooks.
"""
course
=
get_course_with_access
(
request
.
user
,
course_id
,
'load'
)
staff_access
=
has_access
(
request
.
user
,
course
,
'staff'
)
...
...
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