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
3d955523
Commit
3d955523
authored
Oct 23, 2014
by
Chris Dodge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow for overrides on ENABLE_PAID_COURSE_REIGSTRATIONS via mircosites
parent
01c029aa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
6 deletions
+19
-6
lms/djangoapps/shoppingcart/context_processor.py
+19
-6
No files found.
lms/djangoapps/shoppingcart/context_processor.py
View file @
3d955523
...
@@ -7,6 +7,7 @@ navigation. We want to do this in the context_processor to
...
@@ -7,6 +7,7 @@ navigation. We want to do this in the context_processor to
"""
"""
from
django.conf
import
settings
from
django.conf
import
settings
import
shoppingcart
import
shoppingcart
from
microsite_configuration
import
microsite
def
user_has_cart_context_processor
(
request
):
def
user_has_cart_context_processor
(
request
):
...
@@ -15,12 +16,24 @@ def user_has_cart_context_processor(request):
...
@@ -15,12 +16,24 @@ def user_has_cart_context_processor(request):
be displayed. Anonymous users don't.
be displayed. Anonymous users don't.
Adds `display_shopping_cart` to the context
Adds `display_shopping_cart` to the context
"""
"""
return
{
'display_shopping_cart'
:
(
display_shopping_cart
=
(
request
.
user
.
is_authenticated
()
and
# user is logged in and
# user is logged in and
settings
.
FEATURES
.
get
(
'ENABLE_PAID_COURSE_REGISTRATION'
)
and
# settings enable paid course reg and
request
.
user
.
is_authenticated
()
and
settings
.
FEATURES
.
get
(
'ENABLE_SHOPPING_CART'
)
and
# settings enable shopping cart and
# settings enable paid course reg
microsite
.
get_value
(
'ENABLE_PAID_COURSE_REGISTRATION'
,
settings
.
FEATURES
.
get
(
'ENABLE_PAID_COURSE_REGISTRATION'
)
)
and
# settings enable shopping cart
microsite
.
get_value
(
'ENABLE_SHOPPING_CART'
,
settings
.
FEATURES
.
get
(
'ENABLE_SHOPPING_CART'
)
)
and
# user's cart has PaidCourseRegistrations
shoppingcart
.
models
.
Order
.
user_cart_has_items
(
shoppingcart
.
models
.
Order
.
user_cart_has_items
(
request
.
user
,
request
.
user
,
[
shoppingcart
.
models
.
PaidCourseRegistration
,
shoppingcart
.
models
.
CourseRegCodeItem
]
[
shoppingcart
.
models
.
PaidCourseRegistration
,
shoppingcart
.
models
.
CourseRegCodeItem
]
)
# user's cart has PaidCourseRegistrations
)
)}
)
return
{
'display_shopping_cart'
:
display_shopping_cart
}
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