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
096d6853
Commit
096d6853
authored
Oct 11, 2012
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow for branding subdomains that are longer than a single .
parent
9e9825cb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
lms/djangoapps/branding/__init__.py
+7
-6
lms/envs/cms/dev.py
+1
-0
No files found.
lms/djangoapps/branding/__init__.py
View file @
096d6853
...
@@ -4,8 +4,11 @@ from xmodule.course_module import CourseDescriptor
...
@@ -4,8 +4,11 @@ from xmodule.course_module import CourseDescriptor
from
django.conf
import
settings
from
django.conf
import
settings
def
get_subdomain
(
domain
):
def
pick_subdomain
(
domain
,
options
,
default
=
'default'
):
return
domain
.
split
(
"."
)[
0
]
for
option
in
options
:
if
domain
.
startswith
(
option
):
return
option
return
default
def
get_visible_courses
(
domain
=
None
):
def
get_visible_courses
(
domain
=
None
):
...
@@ -17,9 +20,7 @@ def get_visible_courses(domain=None):
...
@@ -17,9 +20,7 @@ def get_visible_courses(domain=None):
courses
=
sorted
(
courses
,
key
=
lambda
course
:
course
.
number
)
courses
=
sorted
(
courses
,
key
=
lambda
course
:
course
.
number
)
if
domain
and
settings
.
MITX_FEATURES
.
get
(
'SUBDOMAIN_COURSE_LISTINGS'
):
if
domain
and
settings
.
MITX_FEATURES
.
get
(
'SUBDOMAIN_COURSE_LISTINGS'
):
subdomain
=
get_subdomain
(
domain
)
subdomain
=
pick_subdomain
(
domain
,
settings
.
COURSE_LISTINGS
.
keys
())
if
subdomain
not
in
settings
.
COURSE_LISTINGS
:
subdomain
=
'default'
visible_ids
=
frozenset
(
settings
.
COURSE_LISTINGS
[
subdomain
])
visible_ids
=
frozenset
(
settings
.
COURSE_LISTINGS
[
subdomain
])
return
[
course
for
course
in
courses
if
course
.
id
in
visible_ids
]
return
[
course
for
course
in
courses
if
course
.
id
in
visible_ids
]
else
:
else
:
...
@@ -34,7 +35,7 @@ def get_university(domain=None):
...
@@ -34,7 +35,7 @@ def get_university(domain=None):
if
not
settings
.
MITX_FEATURES
[
'SUBDOMAIN_BRANDING'
]
or
domain
is
None
:
if
not
settings
.
MITX_FEATURES
[
'SUBDOMAIN_BRANDING'
]
or
domain
is
None
:
return
None
return
None
subdomain
=
get_subdomain
(
domain
)
subdomain
=
pick_subdomain
(
domain
,
settings
.
SUBDOMAIN_BRANDING
.
keys
()
)
return
settings
.
SUBDOMAIN_BRANDING
.
get
(
subdomain
)
return
settings
.
SUBDOMAIN_BRANDING
.
get
(
subdomain
)
...
...
lms/envs/cms/dev.py
View file @
096d6853
...
@@ -7,6 +7,7 @@ from ..dev import *
...
@@ -7,6 +7,7 @@ from ..dev import *
MITX_FEATURES
[
'AUTH_USE_MIT_CERTIFICATES'
]
=
False
MITX_FEATURES
[
'AUTH_USE_MIT_CERTIFICATES'
]
=
False
SUBDOMAIN_BRANDING
[
'edge'
]
=
'edge'
SUBDOMAIN_BRANDING
[
'edge'
]
=
'edge'
SUBDOMAIN_BRANDING
[
'preview.edge'
]
=
'edge'
VIRTUAL_UNIVERSITIES
=
[
'edge'
]
VIRTUAL_UNIVERSITIES
=
[
'edge'
]
modulestore_options
=
{
modulestore_options
=
{
...
...
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