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
290ccc52
Commit
290ccc52
authored
Apr 14, 2015
by
Zia Fazal
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #427 from edx-solutions/eugeny/settings-service-backward-compatibility
Settings service backward compatibility
parents
674b8988
2e4caae0
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
12 deletions
+13
-12
cms/envs/aws.py
+2
-0
common/lib/xmodule/xmodule/services.py
+7
-0
common/lib/xmodule/xmodule/settings_service.py
+0
-9
lms/djangoapps/lms_xblock/runtime.py
+2
-3
lms/envs/aws.py
+2
-0
No files found.
cms/envs/aws.py
View file @
290ccc52
...
@@ -326,3 +326,5 @@ NOTIFICATION_MAX_LIST_SIZE = ENV_TOKENS.get('NOTIFICATION_MAX_LIST_SIZE', NOTIFI
...
@@ -326,3 +326,5 @@ NOTIFICATION_MAX_LIST_SIZE = ENV_TOKENS.get('NOTIFICATION_MAX_LIST_SIZE', NOTIFI
#date format the api will be formatting the datetime values
#date format the api will be formatting the datetime values
API_DATE_FORMAT
=
'
%
Y-
%
m-
%
d'
API_DATE_FORMAT
=
'
%
Y-
%
m-
%
d'
API_DATE_FORMAT
=
ENV_TOKENS
.
get
(
'API_DATE_FORMAT'
,
API_DATE_FORMAT
)
API_DATE_FORMAT
=
ENV_TOKENS
.
get
(
'API_DATE_FORMAT'
,
API_DATE_FORMAT
)
XBLOCK_SETTINGS
=
ENV_TOKENS
.
get
(
'XBLOCK_SETTINGS'
,
{})
common/lib/xmodule/xmodule/services.py
View file @
290ccc52
...
@@ -68,6 +68,13 @@ class SettingsService(object):
...
@@ -68,6 +68,13 @@ class SettingsService(object):
xblock_settings
=
settings
.
XBLOCK_SETTINGS
if
hasattr
(
settings
,
"XBLOCK_SETTINGS"
)
else
{}
xblock_settings
=
settings
.
XBLOCK_SETTINGS
if
hasattr
(
settings
,
"XBLOCK_SETTINGS"
)
else
{}
return
xblock_settings
.
get
(
xblock_settings_bucket
,
actual_default
)
return
xblock_settings
.
get
(
xblock_settings_bucket
,
actual_default
)
def
get
(
self
,
setting_name
):
"""
Temporary method available only on solutions branch until ooyala XBlock is updated
to use get_settings_bucket()
"""
return
getattr
(
settings
,
setting_name
)
class
NotificationsService
(
object
):
class
NotificationsService
(
object
):
"""
"""
...
...
common/lib/xmodule/xmodule/settings_service.py
deleted
100644 → 0
View file @
674b8988
"""
XBlock service to allow to access the server settings
"""
from
django.conf
import
settings
class
SettingsService
(
object
):
def
get
(
self
,
setting_name
):
return
getattr
(
settings
,
setting_name
)
lms/djangoapps/lms_xblock/runtime.py
View file @
290ccc52
...
@@ -5,16 +5,15 @@ Module implementing `xblock.runtime.Runtime` functionality for the LMS
...
@@ -5,16 +5,15 @@ Module implementing `xblock.runtime.Runtime` functionality for the LMS
import
re
import
re
import
xblock.reference.plugins
import
xblock.reference.plugins
from
django.conf
import
settings
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
from
django.conf
import
settings
from
django.conf
import
settings
from
lms.djangoapps.lms_xblock.models
import
XBlockAsidesConfig
from
lms.djangoapps.lms_xblock.models
import
XBlockAsidesConfig
from
openedx.core.djangoapps.user_api.api
import
course_tag
as
user_course_tag_api
from
openedx.core.djangoapps.user_api.api
import
course_tag
as
user_course_tag_api
from
xmodule.modulestore.django
import
modulestore
from
xmodule.modulestore.django
import
modulestore
from
xmodule.services
import
SettingsService
from
xmodule.library_tools
import
LibraryToolsService
from
xmodule.library_tools
import
LibraryToolsService
from
xmodule.x_module
import
ModuleSystem
from
xmodule.x_module
import
ModuleSystem
from
xmodule.partitions.partitions_service
import
PartitionService
from
xmodule.partitions.partitions_service
import
PartitionService
from
xmodule.settings_service
import
SettingsService
def
_quote_slashes
(
match
):
def
_quote_slashes
(
match
):
...
@@ -259,7 +258,6 @@ class LmsModuleSystem(LmsHandlerUrls, LmsCourse, LmsUser, ModuleSystem): # pyli
...
@@ -259,7 +258,6 @@ class LmsModuleSystem(LmsHandlerUrls, LmsCourse, LmsUser, ModuleSystem): # pyli
"""
"""
def
__init__
(
self
,
**
kwargs
):
def
__init__
(
self
,
**
kwargs
):
services
=
kwargs
.
setdefault
(
'services'
,
{})
services
=
kwargs
.
setdefault
(
'services'
,
{})
services
[
'settings'
]
=
SettingsService
()
services
[
'user_tags'
]
=
UserTagsService
(
self
)
services
[
'user_tags'
]
=
UserTagsService
(
self
)
services
[
'partitions'
]
=
LmsPartitionService
(
services
[
'partitions'
]
=
LmsPartitionService
(
user
=
kwargs
.
get
(
'user'
),
user
=
kwargs
.
get
(
'user'
),
...
@@ -268,6 +266,7 @@ class LmsModuleSystem(LmsHandlerUrls, LmsCourse, LmsUser, ModuleSystem): # pyli
...
@@ -268,6 +266,7 @@ class LmsModuleSystem(LmsHandlerUrls, LmsCourse, LmsUser, ModuleSystem): # pyli
)
)
services
[
'library_tools'
]
=
LibraryToolsService
(
modulestore
())
services
[
'library_tools'
]
=
LibraryToolsService
(
modulestore
())
services
[
'fs'
]
=
xblock
.
reference
.
plugins
.
FSService
()
services
[
'fs'
]
=
xblock
.
reference
.
plugins
.
FSService
()
services
[
'settings'
]
=
SettingsService
()
self
.
request_token
=
kwargs
.
pop
(
'request_token'
,
None
)
self
.
request_token
=
kwargs
.
pop
(
'request_token'
,
None
)
super
(
LmsModuleSystem
,
self
)
.
__init__
(
**
kwargs
)
super
(
LmsModuleSystem
,
self
)
.
__init__
(
**
kwargs
)
...
...
lms/envs/aws.py
View file @
290ccc52
...
@@ -573,3 +573,5 @@ NOTIFICATION_CHANNEL_PROVIDER_TYPE_MAPS = ENV_TOKENS.get(
...
@@ -573,3 +573,5 @@ NOTIFICATION_CHANNEL_PROVIDER_TYPE_MAPS = ENV_TOKENS.get(
NOTIFICATION_CHANNEL_PROVIDER_TYPE_MAPS
NOTIFICATION_CHANNEL_PROVIDER_TYPE_MAPS
)
)
NOTIFICATION_MAX_LIST_SIZE
=
ENV_TOKENS
.
get
(
'NOTIFICATION_MAX_LIST_SIZE'
,
NOTIFICATION_MAX_LIST_SIZE
)
NOTIFICATION_MAX_LIST_SIZE
=
ENV_TOKENS
.
get
(
'NOTIFICATION_MAX_LIST_SIZE'
,
NOTIFICATION_MAX_LIST_SIZE
)
XBLOCK_SETTINGS
=
ENV_TOKENS
.
get
(
'XBLOCK_SETTINGS'
,
{})
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