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
0162b370
Commit
0162b370
authored
Nov 02, 2017
by
Clinton Blackburn
Committed by
Clinton Blackburn
Nov 02, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed CourseMode admin search
Searching by course run key no longer raises an exception.
parent
c3ebad65
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
21 deletions
+9
-21
common/djangoapps/course_modes/admin.py
+9
-21
No files found.
common/djangoapps/course_modes/admin.py
View file @
0162b370
"""
Django admin page for course modes
"""
from
django.conf
import
settings
from
django
import
forms
from
django
import
forms
from
django.
utils.translation
import
ugettext_lazy
as
_
from
django.
conf
import
settings
from
django.contrib
import
admin
from
django.contrib
import
admin
from
django.utils.translation
import
ugettext_lazy
as
_
from
pytz
import
timezone
,
UTC
from
opaque_keys.edx.keys
import
CourseKey
from
opaque_keys
import
InvalidKeyError
from
opaque_keys
import
InvalidKeyError
from
opaque_keys.edx.keys
import
CourseKey
from
pytz
import
UTC
,
timezone
from
util.date_utils
import
get_time_display
from
xmodule.modulestore.django
import
modulestore
from
course_modes.models
import
CourseMode
,
CourseModeExpirationConfig
from
course_modes.models
import
CourseMode
,
CourseModeExpirationConfig
# Technically, we shouldn't be doing this, since verify_student is defined
# Technically, we shouldn't be doing this, since verify_student is defined
# in LMS, and course_modes is defined in common.
# in LMS, and course_modes is defined in common.
#
#
...
@@ -26,6 +18,8 @@ from course_modes.models import CourseMode, CourseModeExpirationConfig
...
@@ -26,6 +18,8 @@ from course_modes.models import CourseMode, CourseModeExpirationConfig
# but the test suite for Studio will fail because
# but the test suite for Studio will fail because
# the verification deadline table won't exist.
# the verification deadline table won't exist.
from
lms.djangoapps.verify_student
import
models
as
verification_models
from
lms.djangoapps.verify_student
import
models
as
verification_models
from
util.date_utils
import
get_time_display
from
xmodule.modulestore.django
import
modulestore
COURSE_MODE_SLUG_CHOICES
=
[(
mode_slug
,
mode_slug
)
for
mode_slug
in
settings
.
COURSE_ENROLLMENT_MODES
]
COURSE_MODE_SLUG_CHOICES
=
[(
mode_slug
,
mode_slug
)
for
mode_slug
in
settings
.
COURSE_ENROLLMENT_MODES
]
...
@@ -170,6 +164,7 @@ class CourseModeForm(forms.ModelForm):
...
@@ -170,6 +164,7 @@ class CourseModeForm(forms.ModelForm):
return
super
(
CourseModeForm
,
self
)
.
save
(
commit
=
commit
)
return
super
(
CourseModeForm
,
self
)
.
save
(
commit
=
commit
)
@admin.register
(
CourseMode
)
class
CourseModeAdmin
(
admin
.
ModelAdmin
):
class
CourseModeAdmin
(
admin
.
ModelAdmin
):
"""Admin for course modes"""
"""Admin for course modes"""
form
=
CourseModeForm
form
=
CourseModeForm
...
@@ -186,7 +181,7 @@ class CourseModeAdmin(admin.ModelAdmin):
...
@@ -186,7 +181,7 @@ class CourseModeAdmin(admin.ModelAdmin):
'bulk_sku'
'bulk_sku'
)
)
search_fields
=
(
'course'
,)
search_fields
=
(
'course
__id
'
,)
list_display
=
(
list_display
=
(
'id'
,
'id'
,
...
@@ -208,11 +203,4 @@ class CourseModeAdmin(admin.ModelAdmin):
...
@@ -208,11 +203,4 @@ class CourseModeAdmin(admin.ModelAdmin):
expiration_datetime_custom
.
short_description
=
"Upgrade Deadline"
expiration_datetime_custom
.
short_description
=
"Upgrade Deadline"
class
CourseModeExpirationConfigAdmin
(
admin
.
ModelAdmin
):
admin
.
site
.
register
(
CourseModeExpirationConfig
)
"""Admin interface for the course mode auto expiration configuration. """
class
Meta
(
object
):
model
=
CourseModeExpirationConfig
admin
.
site
.
register
(
CourseMode
,
CourseModeAdmin
)
admin
.
site
.
register
(
CourseModeExpirationConfig
,
CourseModeExpirationConfigAdmin
)
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