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
11454640
Commit
11454640
authored
May 25, 2016
by
Hasnain
Committed by
Douglas Hall
Jun 01, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added middleware to redirect the user from expired course page to all courses page.
parent
7fa763b2
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
32 additions
and
15 deletions
+32
-15
cms/envs/common.py
+4
-0
lms/djangoapps/courseware/tests/test_course_info.py
+2
-2
lms/djangoapps/django_comment_client/base/tests.py
+4
-4
lms/envs/common.py
+15
-3
openedx/core/djangoapps/bookmarks/tests/test_views.py
+1
-1
openedx/core/djangoapps/theming/tests/__init__.py
+0
-0
openedx/core/djangoapps/user_api/accounts/tests/test_views.py
+5
-5
requirements/edx/base.txt
+1
-0
No files found.
cms/envs/common.py
View file @
11454640
...
...
@@ -787,6 +787,7 @@ INSTALLED_APPS = (
# Standard apps
'django.contrib.auth'
,
'django.contrib.contenttypes'
,
'django.contrib.redirects'
,
'django.contrib.sessions'
,
'django.contrib.sites'
,
'django.contrib.messages'
,
...
...
@@ -912,6 +913,9 @@ INSTALLED_APPS = (
# Tagging
'cms.lib.xblock.tagging'
,
# Enables default site and redirects
'django_sites_extensions'
,
)
...
...
lms/djangoapps/courseware/tests/test_course_info.py
View file @
11454640
...
...
@@ -289,7 +289,7 @@ class SelfPacedCourseInfoTestCase(LoginEnrollmentTestCase, SharedModuleStoreTest
self
.
assertEqual
(
resp
.
status_code
,
200
)
def
test_num_queries_instructor_paced
(
self
):
self
.
fetch_course_info_with_queries
(
self
.
instructor_paced_course
,
2
0
,
4
)
self
.
fetch_course_info_with_queries
(
self
.
instructor_paced_course
,
2
1
,
4
)
def
test_num_queries_self_paced
(
self
):
self
.
fetch_course_info_with_queries
(
self
.
self_paced_course
,
2
0
,
4
)
self
.
fetch_course_info_with_queries
(
self
.
self_paced_course
,
2
1
,
4
)
lms/djangoapps/django_comment_client/base/tests.py
View file @
11454640
...
...
@@ -372,8 +372,8 @@ class ViewsQueryCountTestCase(UrlResetMixin, ModuleStoreTestCase, MockRequestSet
return
inner
@ddt.data
(
(
ModuleStoreEnum
.
Type
.
mongo
,
3
,
4
,
2
6
),
(
ModuleStoreEnum
.
Type
.
split
,
3
,
13
,
2
6
),
(
ModuleStoreEnum
.
Type
.
mongo
,
3
,
4
,
2
9
),
(
ModuleStoreEnum
.
Type
.
split
,
3
,
13
,
2
9
),
)
@ddt.unpack
@count_queries
...
...
@@ -381,8 +381,8 @@ class ViewsQueryCountTestCase(UrlResetMixin, ModuleStoreTestCase, MockRequestSet
self
.
create_thread_helper
(
mock_request
)
@ddt.data
(
(
ModuleStoreEnum
.
Type
.
mongo
,
3
,
3
,
2
0
),
(
ModuleStoreEnum
.
Type
.
split
,
3
,
10
,
2
0
),
(
ModuleStoreEnum
.
Type
.
mongo
,
3
,
3
,
2
3
),
(
ModuleStoreEnum
.
Type
.
split
,
3
,
10
,
2
3
),
)
@ddt.unpack
@count_queries
...
...
lms/envs/common.py
View file @
11454640
...
...
@@ -1093,6 +1093,10 @@ MIDDLEWARE_CLASSES = (
'microsite_configuration.middleware.MicrositeMiddleware'
,
'django_comment_client.middleware.AjaxExceptionMiddleware'
,
'django.middleware.common.CommonMiddleware'
,
'django.contrib.sites.middleware.CurrentSiteMiddleware'
,
# Allows us to define redirects via Django admin
'django_sites_extensions.middleware.RedirectMiddleware'
,
# Instead of SessionMiddleware, we use a more secure version
# 'django.contrib.sessions.middleware.SessionMiddleware',
...
...
@@ -1823,6 +1827,7 @@ INSTALLED_APPS = (
'django.contrib.contenttypes'
,
'django.contrib.humanize'
,
'django.contrib.messages'
,
'django.contrib.redirects'
,
'django.contrib.sessions'
,
'django.contrib.sites'
,
'django.contrib.staticfiles'
,
...
...
@@ -2050,6 +2055,9 @@ INSTALLED_APPS = (
# Needed whether or not enabled, due to migrations
'badges'
,
# Enables default site and redirects
'django_sites_extensions'
,
)
# Migrations which are not in the standard module "migrations"
...
...
@@ -2888,9 +2896,6 @@ CREDENTIALS_GENERATION_ROUTING_KEY = HIGH_PRIORITY_QUEUE
WIKI_REQUEST_CACHE_MIDDLEWARE_CLASS
=
"request_cache.middleware.RequestCache"
# Dafault site id to use in case there is no site that matches with the request headers.
DEFAULT_SITE_ID
=
1
# API access management
API_ACCESS_MANAGER_EMAIL
=
'api-access@example.com'
API_ACCESS_FROM_EMAIL
=
'api-requests@example.com'
...
...
@@ -2899,3 +2904,10 @@ AUTH_DOCUMENTATION_URL = 'http://edx.readthedocs.org/projects/edx-platform-api/e
# Affiliate cookie tracking
AFFILIATE_COOKIE_NAME
=
'affiliate_id'
############## Settings for RedirectMiddleware ###############
# Setting this to None causes Redirect data to never expire
# The cache is cleared when Redirect models are saved/deleted
REDIRECT_CACHE_TIMEOUT
=
None
# The length of time we cache Redirect model data
REDIRECT_CACHE_KEY_PREFIX
=
'redirects'
openedx/core/djangoapps/bookmarks/tests/test_views.py
View file @
11454640
...
...
@@ -268,7 +268,7 @@ class BookmarksListViewTests(BookmarksViewsTestsBase):
self
.
assertEqual
(
response
.
data
[
'developer_message'
],
u'Parameter usage_id not provided.'
)
# Send empty data dictionary.
with
self
.
assertNumQueries
(
6
):
# No queries for bookmark table.
with
self
.
assertNumQueries
(
7
):
# No queries for bookmark table.
response
=
self
.
send_post
(
client
=
self
.
client
,
url
=
reverse
(
'bookmarks'
),
...
...
openedx/core/djangoapps/theming/tests/__init__.py
deleted
100644 → 0
View file @
7fa763b2
openedx/core/djangoapps/user_api/accounts/tests/test_views.py
View file @
11454640
...
...
@@ -248,7 +248,7 @@ class TestAccountAPI(CacheIsolationTestCase, UserAPITestCase):
"""
self
.
different_client
.
login
(
username
=
self
.
different_user
.
username
,
password
=
self
.
test_password
)
self
.
create_mock_profile
(
self
.
user
)
with
self
.
assertNumQueries
(
1
4
):
with
self
.
assertNumQueries
(
1
7
):
response
=
self
.
send_get
(
self
.
different_client
)
self
.
_verify_full_shareable_account_response
(
response
,
account_privacy
=
ALL_USERS_VISIBILITY
)
...
...
@@ -263,7 +263,7 @@ class TestAccountAPI(CacheIsolationTestCase, UserAPITestCase):
"""
self
.
different_client
.
login
(
username
=
self
.
different_user
.
username
,
password
=
self
.
test_password
)
self
.
create_mock_profile
(
self
.
user
)
with
self
.
assertNumQueries
(
1
4
):
with
self
.
assertNumQueries
(
1
7
):
response
=
self
.
send_get
(
self
.
different_client
)
self
.
_verify_private_account_response
(
response
,
account_privacy
=
PRIVATE_VISIBILITY
)
...
...
@@ -337,12 +337,12 @@ class TestAccountAPI(CacheIsolationTestCase, UserAPITestCase):
self
.
assertEqual
(
False
,
data
[
"accomplishments_shared"
])
self
.
client
.
login
(
username
=
self
.
user
.
username
,
password
=
self
.
test_password
)
verify_get_own_information
(
1
2
)
verify_get_own_information
(
1
5
)
# Now make sure that the user can get the same information, even if not active
self
.
user
.
is_active
=
False
self
.
user
.
save
()
verify_get_own_information
(
9
)
verify_get_own_information
(
10
)
def
test_get_account_empty_string
(
self
):
"""
...
...
@@ -356,7 +356,7 @@ class TestAccountAPI(CacheIsolationTestCase, UserAPITestCase):
legacy_profile
.
save
()
self
.
client
.
login
(
username
=
self
.
user
.
username
,
password
=
self
.
test_password
)
with
self
.
assertNumQueries
(
1
2
):
with
self
.
assertNumQueries
(
1
5
):
response
=
self
.
send_get
(
self
.
client
)
for
empty_field
in
(
"level_of_education"
,
"gender"
,
"country"
,
"bio"
):
self
.
assertIsNone
(
response
.
data
[
empty_field
])
...
...
requirements/edx/base.txt
View file @
11454640
...
...
@@ -42,6 +42,7 @@ edx-ccx-keys==0.1.2
edx-drf-extensions==0.5.1
edx-lint==0.4.3
edx-django-oauth2-provider==1.0.3
edx-django-sites-extensions==2.0.1
edx-oauth2-provider==1.0.1
edx-opaque-keys==0.2.1
edx-organizations==0.4.1
...
...
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