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
4050da6b
Commit
4050da6b
authored
Mar 28, 2013
by
Carlos Andrés Rocha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable meta-universities (organizations that contain other)
parent
fece9376
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
7 deletions
+29
-7
lms/djangoapps/courseware/views.py
+24
-7
lms/envs/aws.py
+1
-0
lms/envs/cms/dev.py
+1
-0
lms/envs/dev.py
+3
-0
No files found.
lms/djangoapps/courseware/views.py
View file @
4050da6b
...
@@ -522,6 +522,12 @@ def static_university_profile(request, org_id):
...
@@ -522,6 +522,12 @@ def static_university_profile(request, org_id):
"""
"""
Return the profile for the particular org_id that does not have any courses.
Return the profile for the particular org_id that does not have any courses.
"""
"""
# Redirect to the properly capitalized org_id
last_path
=
request
.
path
.
split
(
'/'
)[
-
1
]
if
last_path
!=
org_id
:
return
redirect
(
'static_university_profile'
,
org_id
=
org_id
)
# Render template
template_file
=
"university_profile/{0}.html"
.
format
(
org_id
)
.
lower
()
template_file
=
"university_profile/{0}.html"
.
format
(
org_id
)
.
lower
()
context
=
dict
(
courses
=
[],
org_id
=
org_id
)
context
=
dict
(
courses
=
[],
org_id
=
org_id
)
return
render_to_response
(
template_file
,
context
)
return
render_to_response
(
template_file
,
context
)
...
@@ -533,17 +539,28 @@ def university_profile(request, org_id):
...
@@ -533,17 +539,28 @@ def university_profile(request, org_id):
"""
"""
Return the profile for the particular org_id. 404 if it's not valid.
Return the profile for the particular org_id. 404 if it's not valid.
"""
"""
virtual_orgs_ids
=
settings
.
VIRTUAL_UNIVERSITIES
meta_orgs
=
getattr
(
settings
,
'META_UNIVERSITIES'
,
{})
# Get all the ids associated with this organization
all_courses
=
modulestore
()
.
get_courses
()
all_courses
=
modulestore
()
.
get_courses
()
valid_org_ids
=
set
(
c
.
org
for
c
in
all_courses
)
.
union
(
settings
.
VIRTUAL_UNIVERSITIES
)
valid_orgs_ids
=
set
(
c
.
org
for
c
in
all_courses
)
if
org_id
not
in
valid_org_ids
:
valid_orgs_ids
.
update
(
virtual_orgs_ids
+
meta_orgs
.
keys
())
if
org_id
not
in
valid_orgs_ids
:
raise
Http404
(
"University Profile not found for {0}"
.
format
(
org_id
))
raise
Http404
(
"University Profile not found for {0}"
.
format
(
org_id
))
# Only grab courses for this org...
# Grab all courses for this organization(s)
courses
=
get_courses_by_university
(
request
.
user
,
org_ids
=
set
([
org_id
]
+
meta_orgs
.
get
(
org_id
,
[]))
domain
=
request
.
META
.
get
(
'HTTP_HOST'
))[
org_id
]
org_courses
=
[]
courses
=
sort_by_announcement
(
courses
)
domain
=
request
.
META
.
get
(
'HTTP_HOST'
)
for
key
in
org_ids
:
cs
=
get_courses_by_university
(
request
.
user
,
domain
=
domain
)[
key
]
org_courses
.
extend
(
cs
)
org_courses
=
sort_by_announcement
(
org_courses
)
context
=
dict
(
courses
=
courses
,
org_id
=
org_id
)
context
=
dict
(
courses
=
org_
courses
,
org_id
=
org_id
)
template_file
=
"university_profile/{0}.html"
.
format
(
org_id
)
.
lower
()
template_file
=
"university_profile/{0}.html"
.
format
(
org_id
)
.
lower
()
return
render_to_response
(
template_file
,
context
)
return
render_to_response
(
template_file
,
context
)
...
...
lms/envs/aws.py
View file @
4050da6b
...
@@ -76,6 +76,7 @@ LOGGING = get_logger_config(LOG_DIR,
...
@@ -76,6 +76,7 @@ LOGGING = get_logger_config(LOG_DIR,
COURSE_LISTINGS
=
ENV_TOKENS
.
get
(
'COURSE_LISTINGS'
,
{})
COURSE_LISTINGS
=
ENV_TOKENS
.
get
(
'COURSE_LISTINGS'
,
{})
SUBDOMAIN_BRANDING
=
ENV_TOKENS
.
get
(
'SUBDOMAIN_BRANDING'
,
{})
SUBDOMAIN_BRANDING
=
ENV_TOKENS
.
get
(
'SUBDOMAIN_BRANDING'
,
{})
VIRTUAL_UNIVERSITIES
=
ENV_TOKENS
.
get
(
'VIRTUAL_UNIVERSITIES'
,
[])
VIRTUAL_UNIVERSITIES
=
ENV_TOKENS
.
get
(
'VIRTUAL_UNIVERSITIES'
,
[])
META_UNIVERSITIES
=
ENV_TOKENS
.
get
(
'META_UNIVERSITIES'
,
{})
COMMENTS_SERVICE_URL
=
ENV_TOKENS
.
get
(
"COMMENTS_SERVICE_URL"
,
''
)
COMMENTS_SERVICE_URL
=
ENV_TOKENS
.
get
(
"COMMENTS_SERVICE_URL"
,
''
)
COMMENTS_SERVICE_KEY
=
ENV_TOKENS
.
get
(
"COMMENTS_SERVICE_KEY"
,
''
)
COMMENTS_SERVICE_KEY
=
ENV_TOKENS
.
get
(
"COMMENTS_SERVICE_KEY"
,
''
)
CERT_QUEUE
=
ENV_TOKENS
.
get
(
"CERT_QUEUE"
,
'test-pull'
)
CERT_QUEUE
=
ENV_TOKENS
.
get
(
"CERT_QUEUE"
,
'test-pull'
)
...
...
lms/envs/cms/dev.py
View file @
4050da6b
...
@@ -9,6 +9,7 @@ MITX_FEATURES['AUTH_USE_MIT_CERTIFICATES'] = False
...
@@ -9,6 +9,7 @@ MITX_FEATURES['AUTH_USE_MIT_CERTIFICATES'] = False
SUBDOMAIN_BRANDING
[
'edge'
]
=
'edge'
SUBDOMAIN_BRANDING
[
'edge'
]
=
'edge'
SUBDOMAIN_BRANDING
[
'preview.edge'
]
=
'edge'
SUBDOMAIN_BRANDING
[
'preview.edge'
]
=
'edge'
VIRTUAL_UNIVERSITIES
=
[
'edge'
]
VIRTUAL_UNIVERSITIES
=
[
'edge'
]
META_UNIVERSITIES
=
{}
modulestore_options
=
{
modulestore_options
=
{
'default_class'
:
'xmodule.raw_module.RawDescriptor'
,
'default_class'
:
'xmodule.raw_module.RawDescriptor'
,
...
...
lms/envs/dev.py
View file @
4050da6b
...
@@ -113,6 +113,9 @@ SUBDOMAIN_BRANDING = {
...
@@ -113,6 +113,9 @@ SUBDOMAIN_BRANDING = {
# have an actual course with that org set
# have an actual course with that org set
VIRTUAL_UNIVERSITIES
=
[]
VIRTUAL_UNIVERSITIES
=
[]
# Organization that contain other organizations
META_UNIVERSITIES
=
{
'UTx'
:
[
'UTAustinX'
]}
COMMENTS_SERVICE_KEY
=
"PUT_YOUR_API_KEY_HERE"
COMMENTS_SERVICE_KEY
=
"PUT_YOUR_API_KEY_HERE"
############################## Course static files ##########################
############################## Course static files ##########################
...
...
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