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
409a947c
Commit
409a947c
authored
Feb 05, 2016
by
Toby Lawrence
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #11435 from edx/bugfix/add-admin-for-ext-exclusion
Fix up the excluded extensions bit.
parents
481f3227
b03ee49a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
2 deletions
+22
-2
common/djangoapps/static_replace/admin.py
+21
-1
common/djangoapps/static_replace/models.py
+1
-1
No files found.
common/djangoapps/static_replace/admin.py
View file @
409a947c
...
...
@@ -5,7 +5,7 @@ that gets prepended to asset URLs in order to serve them from, say, a CDN.
from
django.contrib
import
admin
from
config_models.admin
import
ConfigurationModelAdmin
from
.models
import
AssetBaseUrlConfig
from
.models
import
AssetBaseUrlConfig
,
AssetExcludedExtensionsConfig
class
AssetBaseUrlConfigAdmin
(
ConfigurationModelAdmin
):
...
...
@@ -27,4 +27,24 @@ class AssetBaseUrlConfigAdmin(ConfigurationModelAdmin):
return
self
.
list_display
class
AssetExcludedExtensionsConfigAdmin
(
ConfigurationModelAdmin
):
"""
Basic configuration for asset base URL.
"""
list_display
=
[
'excluded_extensions'
]
def
get_list_display
(
self
,
request
):
"""
Restore default list_display behavior.
ConfigurationModelAdmin overrides this, but in a way that doesn't
respect the ordering. This lets us customize it the usual Django admin
way.
"""
return
self
.
list_display
admin
.
site
.
register
(
AssetBaseUrlConfig
,
AssetBaseUrlConfigAdmin
)
admin
.
site
.
register
(
AssetExcludedExtensionsConfig
,
AssetExcludedExtensionsConfigAdmin
)
common/djangoapps/static_replace/models.py
View file @
409a947c
...
...
@@ -48,7 +48,7 @@ class AssetExcludedExtensionsConfig(ConfigurationModel):
return
map
(
add_period
,
cls
.
current
()
.
excluded_extensions
.
split
())
def
__repr__
(
self
):
return
'<AssetExcludedExtensionsConfig(extensions={})>'
.
format
(
self
.
get_excluded_extensions
()
.
split
()
)
return
'<AssetExcludedExtensionsConfig(extensions={})>'
.
format
(
self
.
get_excluded_extensions
())
def
__unicode__
(
self
):
return
unicode
(
repr
(
self
))
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