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
79e81d69
Commit
79e81d69
authored
Jun 18, 2012
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Delay initializition of the MongoKeyStore until required
parent
5404345b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
6 deletions
+14
-6
cms/djangoapps/contentstore/management/commands/import.py
+3
-4
cms/djangoapps/contentstore/views.py
+1
-1
common/lib/keystore/django.py
+10
-1
No files found.
cms/djangoapps/contentstore/management/commands/import.py
View file @
79e81d69
...
...
@@ -160,9 +160,8 @@ class Command(BaseCommand):
element_actions
[
e
.
tag
](
e
)
for
k
in
results
:
print
k
keystore
.
create_item
(
k
,
'Piotr Mitros'
)
keystore
()
.
create_item
(
k
,
'Piotr Mitros'
)
if
'data'
in
results
[
k
]:
keystore
.
update_item
(
k
,
results
[
k
][
'data'
])
keystore
()
.
update_item
(
k
,
results
[
k
][
'data'
])
if
'children'
in
results
[
k
]:
keystore
.
update_children
(
k
,
results
[
k
][
'children'
])
keystore
()
.
update_children
(
k
,
results
[
k
][
'children'
])
cms/djangoapps/contentstore/views.py
View file @
79e81d69
...
...
@@ -7,6 +7,6 @@ def index(request):
# FIXME (cpennington): These need to be read in from the active user
org
=
'mit.edu'
course
=
'6002xs12'
course
=
keystore
.
get_item
([
'i4x'
,
org
,
course
,
'Course'
,
None
])
course
=
keystore
()
.
get_item
([
'i4x'
,
org
,
course
,
'Course'
,
None
])
weeks
=
course
.
get_children
()
return
render_to_response
(
'index.html'
,
{
'weeks'
:
weeks
})
common/lib/keystore/django.py
View file @
79e81d69
...
...
@@ -9,4 +9,13 @@ from __future__ import absolute_import
from
django.conf
import
settings
from
.mongo
import
MongoKeyStore
keystore
=
MongoKeyStore
(
**
settings
.
KEYSTORE
)
_KEYSTORE
=
None
def
keystore
():
global
_KEYSTORE
if
_KEYSTORE
is
None
:
_KEYSTORE
=
MongoKeyStore
(
**
settings
.
KEYSTORE
)
return
_KEYSTORE
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