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
4e41a42c
Commit
4e41a42c
authored
Aug 20, 2014
by
Ben McMorran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename unsucceeded to in_process
parent
d9432041
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
15 deletions
+15
-15
cms/djangoapps/contentstore/views/course.py
+13
-13
cms/templates/index.html
+2
-2
No files found.
cms/djangoapps/contentstore/views/course.py
View file @
4e41a42c
...
@@ -285,14 +285,14 @@ def _accessible_courses_list(request):
...
@@ -285,14 +285,14 @@ def _accessible_courses_list(request):
return
has_course_access
(
request
.
user
,
course
.
id
)
return
has_course_access
(
request
.
user
,
course
.
id
)
courses
=
filter
(
course_filter
,
modulestore
()
.
get_courses
())
courses
=
filter
(
course_filter
,
modulestore
()
.
get_courses
())
unsucceeded
_course_actions
=
[
in_process
_course_actions
=
[
course
for
course
in
course
for
course
in
CourseRerunState
.
objects
.
find_all
(
CourseRerunState
.
objects
.
find_all
(
exclude_args
=
{
'state'
:
CourseRerunUIStateManager
.
State
.
SUCCEEDED
},
should_display
=
True
exclude_args
=
{
'state'
:
CourseRerunUIStateManager
.
State
.
SUCCEEDED
},
should_display
=
True
)
)
if
has_course_access
(
request
.
user
,
course
.
course_key
)
if
has_course_access
(
request
.
user
,
course
.
course_key
)
]
]
return
courses
,
unsucceeded
_course_actions
return
courses
,
in_process
_course_actions
def
_accessible_courses_list_from_groups
(
request
):
def
_accessible_courses_list_from_groups
(
request
):
...
@@ -300,7 +300,7 @@ def _accessible_courses_list_from_groups(request):
...
@@ -300,7 +300,7 @@ def _accessible_courses_list_from_groups(request):
List all courses available to the logged in user by reversing access group names
List all courses available to the logged in user by reversing access group names
"""
"""
courses_list
=
{}
courses_list
=
{}
unsucceeded
_course_actions
=
[]
in_process
_course_actions
=
[]
instructor_courses
=
UserBasedRole
(
request
.
user
,
CourseInstructorRole
.
ROLE
)
.
courses_with_role
()
instructor_courses
=
UserBasedRole
(
request
.
user
,
CourseInstructorRole
.
ROLE
)
.
courses_with_role
()
staff_courses
=
UserBasedRole
(
request
.
user
,
CourseStaffRole
.
ROLE
)
.
courses_with_role
()
staff_courses
=
UserBasedRole
(
request
.
user
,
CourseStaffRole
.
ROLE
)
.
courses_with_role
()
...
@@ -313,7 +313,7 @@ def _accessible_courses_list_from_groups(request):
...
@@ -313,7 +313,7 @@ def _accessible_courses_list_from_groups(request):
raise
AccessListFallback
raise
AccessListFallback
if
course_key
not
in
courses_list
:
if
course_key
not
in
courses_list
:
# check for any course action state for this course
# check for any course action state for this course
unsucceeded
_course_actions
.
extend
(
in_process
_course_actions
.
extend
(
CourseRerunState
.
objects
.
find_all
(
CourseRerunState
.
objects
.
find_all
(
exclude_args
=
{
'state'
:
CourseRerunUIStateManager
.
State
.
SUCCEEDED
},
exclude_args
=
{
'state'
:
CourseRerunUIStateManager
.
State
.
SUCCEEDED
},
should_display
=
True
,
should_display
=
True
,
...
@@ -330,7 +330,7 @@ def _accessible_courses_list_from_groups(request):
...
@@ -330,7 +330,7 @@ def _accessible_courses_list_from_groups(request):
# ignore deleted or errored courses
# ignore deleted or errored courses
courses_list
[
course_key
]
=
course
courses_list
[
course_key
]
=
course
return
courses_list
.
values
(),
unsucceeded
_course_actions
return
courses_list
.
values
(),
in_process
_course_actions
@login_required
@login_required
...
@@ -343,14 +343,14 @@ def course_listing(request):
...
@@ -343,14 +343,14 @@ def course_listing(request):
"""
"""
if
GlobalStaff
()
.
has_user
(
request
.
user
):
if
GlobalStaff
()
.
has_user
(
request
.
user
):
# user has global access so no need to get courses from django groups
# user has global access so no need to get courses from django groups
courses
,
unsucceeded
_course_actions
=
_accessible_courses_list
(
request
)
courses
,
in_process
_course_actions
=
_accessible_courses_list
(
request
)
else
:
else
:
try
:
try
:
courses
,
unsucceeded
_course_actions
=
_accessible_courses_list_from_groups
(
request
)
courses
,
in_process
_course_actions
=
_accessible_courses_list_from_groups
(
request
)
except
AccessListFallback
:
except
AccessListFallback
:
# user have some old groups or there was some error getting courses from django groups
# user have some old groups or there was some error getting courses from django groups
# so fallback to iterating through all courses
# so fallback to iterating through all courses
courses
,
unsucceeded
_course_actions
=
_accessible_courses_list
(
request
)
courses
,
in_process
_course_actions
=
_accessible_courses_list
(
request
)
def
format_course_for_view
(
course
):
def
format_course_for_view
(
course
):
"""
"""
...
@@ -385,19 +385,19 @@ def course_listing(request):
...
@@ -385,19 +385,19 @@ def course_listing(request):
})
if
uca
.
state
==
CourseRerunUIStateManager
.
State
.
FAILED
else
''
})
if
uca
.
state
==
CourseRerunUIStateManager
.
State
.
FAILED
else
''
}
}
# remove any courses in courses that are also in the
unsucceeded
_course_actions list
# remove any courses in courses that are also in the
in_process
_course_actions list
unsucceeded_action_course_keys
=
[
uca
.
course_key
for
uca
in
unsucceeded
_course_actions
]
in_process_action_course_keys
=
[
uca
.
course_key
for
uca
in
in_process
_course_actions
]
courses
=
[
courses
=
[
format_course_for_view
(
c
)
format_course_for_view
(
c
)
for
c
in
courses
for
c
in
courses
if
not
isinstance
(
c
,
ErrorDescriptor
)
and
(
c
.
id
not
in
unsucceeded
_action_course_keys
)
if
not
isinstance
(
c
,
ErrorDescriptor
)
and
(
c
.
id
not
in
in_process
_action_course_keys
)
]
]
unsucceeded_course_actions
=
[
format_unsucceeded_course_for_view
(
uca
)
for
uca
in
unsucceeded
_course_actions
]
in_process_course_actions
=
[
format_unsucceeded_course_for_view
(
uca
)
for
uca
in
in_process
_course_actions
]
return
render_to_response
(
'index.html'
,
{
return
render_to_response
(
'index.html'
,
{
'courses'
:
courses
,
'courses'
:
courses
,
'
unsucceeded_course_actions'
:
unsucceeded
_course_actions
,
'
in_process_course_actions'
:
in_process
_course_actions
,
'user'
:
request
.
user
,
'user'
:
request
.
user
,
'request_course_creator_url'
:
reverse
(
'contentstore.views.request_course_creator'
),
'request_course_creator_url'
:
reverse
(
'contentstore.views.request_course_creator'
),
'course_creator_status'
:
_get_course_creator_status
(
request
.
user
),
'course_creator_status'
:
_get_course_creator_status
(
request
.
user
),
...
...
cms/templates/index.html
View file @
4e41a42c
...
@@ -132,12 +132,12 @@ require(["domReady!", "jquery", "jquery.form", "js/index"], function(doc, $) {
...
@@ -132,12 +132,12 @@ require(["domReady!", "jquery", "jquery.form", "js/index"], function(doc, $) {
% endif
% endif
<!-- STATE: processing courses -->
<!-- STATE: processing courses -->
%if allow_course_reruns and rerun_creator_status and len(
unsucceeded
_course_actions) > 0:
%if allow_course_reruns and rerun_creator_status and len(
in_process
_course_actions) > 0:
<div
class=
"courses courses-processing"
>
<div
class=
"courses courses-processing"
>
<h3
class=
"title"
>
Courses Being Processed
</h3>
<h3
class=
"title"
>
Courses Being Processed
</h3>
<ul
class=
"list-courses"
>
<ul
class=
"list-courses"
>
%for course_info in sorted(
unsucceeded
_course_actions, key=lambda s: s['display_name'].lower() if s['display_name'] is not None else ''):
%for course_info in sorted(
in_process
_course_actions, key=lambda s: s['display_name'].lower() if s['display_name'] is not None else ''):
<!-- STATE: re-run is processing -->
<!-- STATE: re-run is processing -->
%if course_info['is_in_progress']:
%if course_info['is_in_progress']:
<li
class=
"wrapper-course has-status"
data-course-key=
"${course_info['course_key']}"
>
<li
class=
"wrapper-course has-status"
data-course-key=
"${course_info['course_key']}"
>
...
...
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