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
4088ac54
Commit
4088ac54
authored
Sep 05, 2012
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Isolate manual git reload behind a feature flag
parent
579544ec
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
28 deletions
+31
-28
lms/djangoapps/instructor/views.py
+28
-27
lms/envs/common.py
+1
-0
lms/envs/dev.py
+1
-0
lms/templates/courseware/instructor_dashboard.html
+1
-1
No files found.
lms/djangoapps/instructor/views.py
View file @
4088ac54
...
...
@@ -88,34 +88,35 @@ def instructor_dashboard(request, course_id):
# process actions from form POST
action
=
request
.
POST
.
get
(
'action'
,
''
)
if
'GIT pull'
in
action
:
data_dir
=
course
.
metadata
[
'data_dir'
]
log
.
debug
(
'git pull
%
s'
%
(
data_dir
))
gdir
=
settings
.
DATA_DIR
/
data_dir
if
not
os
.
path
.
exists
(
gdir
):
msg
+=
"====> ERROR in gitreload - no such directory
%
s"
%
gdir
else
:
cmd
=
"cd
%
s; git reset --hard HEAD; git clean -f -d; git pull origin; chmod g+w course.xml"
%
gdir
msg
+=
"git pull on
%
s:<p>"
%
data_dir
msg
+=
"<pre>
%
s</pre></p>"
%
escape
(
os
.
popen
(
cmd
)
.
read
())
track
.
views
.
server_track
(
request
,
'git pull
%
s'
%
data_dir
,
{},
page
=
'idashboard'
)
if
'Reload course'
in
action
:
log
.
debug
(
'reloading
%
s (
%
s)'
%
(
course_id
,
course
))
try
:
if
settings
.
MITX_FEATURES
[
'ENABLE_MANUAL_GIT_RELOAD'
]:
if
'GIT pull'
in
action
:
data_dir
=
course
.
metadata
[
'data_dir'
]
modulestore
()
.
try_load_course
(
data_dir
)
msg
+=
"<br/><p>Course reloaded from
%
s</p>"
%
data_dir
track
.
views
.
server_track
(
request
,
'reload
%
s'
%
data_dir
,
{},
page
=
'idashboard'
)
course_errors
=
modulestore
()
.
get_item_errors
(
course
.
location
)
msg
+=
'<ul>'
for
cmsg
,
cerr
in
course_errors
:
msg
+=
"<li>
%
s: <pre>
%
s</pre>"
%
(
cmsg
,
escape
(
cerr
))
msg
+=
'</ul>'
except
Exception
as
err
:
msg
+=
'<br/><p>Error:
%
s</p>'
%
escape
(
err
)
elif
action
==
'Dump list of enrolled students'
:
log
.
debug
(
'git pull
%
s'
%
(
data_dir
))
gdir
=
settings
.
DATA_DIR
/
data_dir
if
not
os
.
path
.
exists
(
gdir
):
msg
+=
"====> ERROR in gitreload - no such directory
%
s"
%
gdir
else
:
cmd
=
"cd
%
s; git reset --hard HEAD; git clean -f -d; git pull origin; chmod g+w course.xml"
%
gdir
msg
+=
"git pull on
%
s:<p>"
%
data_dir
msg
+=
"<pre>
%
s</pre></p>"
%
escape
(
os
.
popen
(
cmd
)
.
read
())
track
.
views
.
server_track
(
request
,
'git pull
%
s'
%
data_dir
,
{},
page
=
'idashboard'
)
if
'Reload course'
in
action
:
log
.
debug
(
'reloading
%
s (
%
s)'
%
(
course_id
,
course
))
try
:
data_dir
=
course
.
metadata
[
'data_dir'
]
modulestore
()
.
try_load_course
(
data_dir
)
msg
+=
"<br/><p>Course reloaded from
%
s</p>"
%
data_dir
track
.
views
.
server_track
(
request
,
'reload
%
s'
%
data_dir
,
{},
page
=
'idashboard'
)
course_errors
=
modulestore
()
.
get_item_errors
(
course
.
location
)
msg
+=
'<ul>'
for
cmsg
,
cerr
in
course_errors
:
msg
+=
"<li>
%
s: <pre>
%
s</pre>"
%
(
cmsg
,
escape
(
cerr
))
msg
+=
'</ul>'
except
Exception
as
err
:
msg
+=
'<br/><p>Error:
%
s</p>'
%
escape
(
err
)
if
action
==
'Dump list of enrolled students'
:
log
.
debug
(
action
)
datatable
=
get_student_grade_summary_data
(
request
,
course
,
course_id
,
get_grades
=
False
)
datatable
[
'title'
]
=
'List of students enrolled in
%
s'
%
course_id
...
...
lms/envs/common.py
View file @
4088ac54
...
...
@@ -73,6 +73,7 @@ MITX_FEATURES = {
'ENABLE_SQL_TRACKING_LOGS'
:
False
,
'ENABLE_LMS_MIGRATION'
:
False
,
'ENABLE_MANUAL_GIT_RELOAD'
:
False
,
'DISABLE_LOGIN_BUTTON'
:
False
,
# used in systems where login is automatic, eg MIT SSL
...
...
lms/envs/dev.py
View file @
4088ac54
...
...
@@ -18,6 +18,7 @@ MITX_FEATURES['ENABLE_SQL_TRACKING_LOGS'] = True
MITX_FEATURES
[
'SUBDOMAIN_COURSE_LISTINGS'
]
=
False
# Enable to test subdomains--otherwise, want all courses to show up
MITX_FEATURES
[
'SUBDOMAIN_BRANDING'
]
=
True
MITX_FEATURES
[
'FORCE_UNIVERSITY_DOMAIN'
]
=
None
# show all university courses if in dev (ie don't use HTTP_HOST)
MITX_FEATURES
[
'ENABLE_MANUAL_GIT_RELOAD'
]
=
True
WIKI_ENABLED
=
True
...
...
lms/templates/courseware/instructor_dashboard.html
View file @
4088ac54
...
...
@@ -71,7 +71,7 @@ table.stat_table td {
<hr
width=
"40%"
style=
"align:left"
>
%endif
%if admin_access:
%if
settings.MITX_FEATURES['ENABLE_MANUAL_GIT_RELOAD'] and
admin_access:
<p>
<input
type=
"submit"
name=
"action"
value=
"Reload course from XML files"
>
<input
type=
"submit"
name=
"action"
value=
"GIT pull and Reload course"
>
...
...
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