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
17263dcd
Commit
17263dcd
authored
Jul 19, 2012
by
David Ormsbee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Keep courses and front page from erroring when we're missing an org in the data.
parent
af4813a7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
common/djangoapps/student/views.py
+2
-2
lms/djangoapps/courseware/views.py
+2
-2
No files found.
common/djangoapps/student/views.py
View file @
17263dcd
...
...
@@ -8,6 +8,7 @@ import uuid
import
feedparser
import
urllib
import
itertools
from
collections
import
defaultdict
from
django.conf
import
settings
from
django.contrib.auth
import
logout
,
authenticate
,
login
...
...
@@ -72,9 +73,8 @@ def index(request):
entry
.
image
=
soup
.
img
[
'src'
]
if
soup
.
img
else
None
courses
=
modulestore
()
.
get_courses
()
universities
=
d
ict
(
)
universities
=
d
efaultdict
(
list
)
for
university
,
group
in
itertools
.
groupby
(
courses
,
lambda
course
:
course
.
org
):
universities
.
setdefault
(
university
,
[])
[
universities
[
university
]
.
append
(
course
)
for
course
in
group
]
return
render_to_response
(
'index.html'
,
{
'universities'
:
universities
,
'entries'
:
entries
})
...
...
lms/djangoapps/courseware/views.py
View file @
17263dcd
from
collections
import
defaultdict
import
logging
import
urllib
import
itertools
...
...
@@ -56,9 +57,8 @@ def format_url_params(params):
def
courses
(
request
):
# TODO: Clean up how 'error' is done.
courses
=
modulestore
()
.
get_courses
()
universities
=
d
ict
(
)
universities
=
d
efaultdict
(
list
)
for
university
,
group
in
itertools
.
groupby
(
courses
,
lambda
course
:
course
.
org
):
universities
.
setdefault
(
university
,
[])
[
universities
[
university
]
.
append
(
course
)
for
course
in
group
]
return
render_to_response
(
"courses.html"
,
{
'universities'
:
universities
})
...
...
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