Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
151 commits
Select commit Hold shift + click to select a range
056225e
Updates the example locations to split format
Nov 9, 2015
6cb62f2
Rebase upgrade Django to v1.8.5
symbolist Sep 18, 2015
607f3bf
Use a branch instead of an unpushed tag for django-splash
Nov 10, 2015
680271d
Correct the darklang migration, since many darklang configs can exist.
Nov 11, 2015
835ecca
Use corrected migrations from edx-submissions
Nov 11, 2015
f55f9af
Fix RemovedInDjango19Warning
muhammad-ammar Nov 11, 2015
a6ec8cd
add django-storages into uninstall list
muhammad-ammar Nov 11, 2015
2bd58aa
Merge pull request #10584 from edx/ammar/uninstall-django-storages
muhammad-ammar Nov 11, 2015
d8403c1
Merge pull request #10583 from edx/ammar/fix-another-RemovedInDjango1…
muhammad-ammar Nov 11, 2015
fb9526b
Update expected_version.
symbolist Nov 11, 2015
8bac42a
Merge pull request #10588 from edx/update-expected-version
symbolist Nov 11, 2015
e7fcc74
More-correct data migrations
Nov 11, 2015
bcf789b
Merge pull request #10590 from edx/ned/dj18-fixed-data-migrations
nedbat Nov 11, 2015
0eea9ad
Disable wiki notifications
Nov 12, 2015
d3f9e1a
Fix the uninstall of django-storages
Nov 12, 2015
ca94745
Merge pull request #10608 from edx/ned/dj18-fix-django-storages-unins…
nedbat Nov 12, 2015
a09012c
Merge pull request #10607 from edx/ned/dj18-disable-wiki-notifications
nedbat Nov 12, 2015
bfb69e5
fix DRF format query param issue
muhammad-ammar Nov 13, 2015
c5fac6c
Update LMS footer links.
Nov 12, 2015
1e6c5b7
Merge pull request #10620 from edx/ammar/fix-drf-format-parm-issue
nedbat Nov 13, 2015
707675d
Use correct version of ora2
Nov 13, 2015
415d31e
Merge pull request #10625 from edx/ned/dj18-use-correct-ora2
nedbat Nov 13, 2015
ccc6e50
Make sure Studio has a secret key
Nov 13, 2015
2f0b849
Merge pull request #10626 from edx/ned/dj18-cms-secret-key
nedbat Nov 13, 2015
02550cb
Disable posting to LinkedIn feature for microsites until we can suppo…
Nov 6, 2015
2c1f7fd
Merge pull request #10629 from edx/bbeggs/dj18-linkedin
Nov 13, 2015
69dc518
Merge branch 'django-upgrade/1.8' into release
macdiesel Nov 17, 2015
8d5f153
Merge remote-tracking branch 'origin/release' into dj18-release-merge
muhammad-ammar Nov 18, 2015
29acc3a
resolve merge conflicts
muhammad-ammar Nov 18, 2015
3e8bf6d
Merge pull request #10661 from edx/dj18-release-merge-fixes
Nov 18, 2015
d8fd8ed
Recreate db caches for bokchoy and lettuce
symbolist Nov 18, 2015
ceaff54
updated edx-organizations with django 1.8 release tag
macdiesel Nov 18, 2015
e3bb513
django-oauth2-provider
Nov 18, 2015
8594896
updated edx-reverification tag
macdiesel Nov 18, 2015
41e9fd1
django-oauth-provider take 2
Nov 18, 2015
647c125
updated edx-milestones to tag release-2015-11-17
macdiesel Nov 18, 2015
ecd0b5f
set tag for edx-search
macdiesel Nov 18, 2015
ece43db
Updated edx-oauth2-provider tag
macdiesel Nov 18, 2015
2977419
Updated edx-val tag
macdiesel Nov 18, 2015
73bf93e
django-openid-auth
Nov 18, 2015
2408c0f
django-pyfs
Nov 18, 2015
a160f10
Add version back to django-oauth2-provider
Nov 18, 2015
e662e86
MA-1190; patch 'read' attribute for thread
wajeeha-khalid Nov 13, 2015
2ab255a
Tag event-tracking.
symbolist Nov 19, 2015
bc22f59
Merge pull request #10664 from edx/usman/regenerate-db-cache
symbolist Nov 19, 2015
6eda0f3
Change django-oauth2-provider to match version
Nov 19, 2015
705bdaa
updated edx-proctoring tag
macdiesel Nov 19, 2015
219a208
Tag lettuce
symbolist Nov 19, 2015
0eabdcb
reverting ora2 tag in github.txt
macdiesel Nov 19, 2015
5b5cf7d
Fix login redirect when user is logged out while answering a question…
adampalay Nov 17, 2015
11a1838
update submissions and ora2 versions
muhammad-ammar Nov 19, 2015
66cbc6a
Update django-wiki reference
Nov 19, 2015
6a58a9c
edx-organizations
Nov 19, 2015
698cea3
Remove errant 'and is'
Nov 19, 2015
a65d599
Update XBlock version
Nov 19, 2015
e4d8b58
Bump tag & version of edx-organizations
Nov 19, 2015
26a4670
Update version of django-splash
Nov 19, 2015
0e66fad
Merge pull request #10667 from edx/dj18/update_all_repo_versions
Nov 19, 2015
141e0a9
Merge branch 'master' into dj18-release-merge
macdiesel Nov 19, 2015
9d18bd6
Adding gettext to ignore
Nov 19, 2015
b7830de
Merge pull request #10659 from edx/dj18-release-merge
Nov 19, 2015
02b43c0
Merge pull request #10562 from edx/ahodges/DOC-2390
Nov 19, 2015
d1efc3f
Updating JSHint threshold
Nov 19, 2015
daf4db8
Update --commit flag so you don't have to say --commit=commit
jibsheet Nov 17, 2015
a2675fe
Merge pull request #10649 from edx/jia/MA-1190
nasthagiri Nov 19, 2015
256dc5b
Reword default about page questions
sarina Nov 19, 2015
7f4dd4d
Merge pull request #10679 from edx/clrux/add-gettext-to-global-jshint…
Nov 19, 2015
f4c5541
be sure to include the enrollment_id when unenrolling
Nov 18, 2015
57a4df7
Management commands should no longer access args[]
jibsheet Nov 17, 2015
84328c1
Pin to what we have in production
jibsheet Nov 19, 2015
6a76db0
Merge pull request #10678 from edx/sarina/reword-aboutpage
sarina Nov 19, 2015
c475f28
edxtest needs to be created on naked systems.
Nov 19, 2015
3c1109f
Merge pull request #10686 from edx/jibsheet/pin-edx-submissions-for-r…
jibsheet Nov 20, 2015
270ab7f
Merge pull request #10685 from edx/jibsheet/saml-pull
jibsheet Nov 20, 2015
149df9b
Django 1.8 disallows access to args[]
jibsheet Nov 17, 2015
0b93054
Allow user to submit initial verification through reverify flow
zubair-arbi Nov 20, 2015
dc7b57f
Cleanup some settings.
symbolist Nov 20, 2015
72fbcdc
Merge pull request #10687 from edx/benp/fix-edxtest-djan18
Nov 20, 2015
7bb4980
Added auto-enrol and email student check boxes to enrolment tab ccx c…
amir-qayyum-khan Nov 17, 2015
8c1d748
Merge pull request #10689 from edx/zub/story/ecom-2933-reverify-flow-…
zubair-arbi Nov 20, 2015
d7953bf
Merge pull request #10682 from edx/jibsheet/delete_orphans-commit
jibsheet Nov 20, 2015
c22d0de
Merge pull request #10690 from edx/usman/fix-settings
symbolist Nov 20, 2015
24d7288
Merge pull request #10684 from edx/jibsheet/force_publish-arg-parsing
jibsheet Nov 20, 2015
21c2d3f
Add in the attempt_code field to the proctoring report
Nov 20, 2015
7c7c0b6
Merge pull request #10670 from edx/cdodge/fix-unenrollment-audit-data
Nov 20, 2015
37dbbf4
Merge pull request #10674 from edx/hotfix/2015-11-19
jibsheet Nov 20, 2015
80614a2
Merge branch 'release' into hotfix-2015-11-20-conflict
jibsheet Nov 20, 2015
b96cd65
remove reset style for button outlines in firefox
Nov 16, 2015
dffcc25
Merge pull request #10694 from edx/hotfix-2015-11-20-conflict
jibsheet Nov 20, 2015
bb43407
Force wrapping for long content like hyperlinks.
Oct 28, 2015
7a858b6
Merge pull request #10405 from edx/aleffert/block-wrapping
aleffert Nov 21, 2015
f5d0f3f
Remove useless pylint suppressions
Nov 22, 2015
dcc86a3
Merge pull request #10703 from edx/ned/remove-useless-pylint-suppression
nedbat Nov 23, 2015
d4d63ec
Merge pull request #10647 from mitocw/enhancement/aq/email_notificati…
pdpinch Nov 23, 2015
68e30f5
Update the django-wiki reference
Nov 23, 2015
5634692
Merge pull request #10708 from edx/ned/fix-wiki-0002-migration
nedbat Nov 23, 2015
6a92d4c
Merge pull request #10639 from edx/clytwynec/remove-firefox-focus-out…
Nov 23, 2015
6f0e7c5
Upgrade to latest 2.x version of pymongo.
feanil Nov 23, 2015
c6f4afc
Header a.dropdown --> button.dropdown
Nov 5, 2015
29b719f
Merge pull request #10527 from edx/clytwynec/ac-230
Nov 23, 2015
2e71a66
GitHub has a capital H
singingwolfboy Nov 23, 2015
0872732
Fix pylint C7630 (literal used as attribute) violations
Nov 23, 2015
995a214
Merge pull request #10710 from edx/feanil/upgrade_pymongo
feanil Nov 23, 2015
a7e21bf
Merge pull request #10707 from edx/ned/fix-pylint-c7630-violations
nedbat Nov 23, 2015
3ae92b9
Use 0.1.4 of i18n-tools so Django 1.8 will work
Nov 24, 2015
fbbf338
Use the latest ORA and submissions API
andy-armstrong Nov 24, 2015
73eb9bd
Update help text for Name field in edx registration
Nov 18, 2015
236d251
Merge pull request #10691 from edx/cdodge/add-attempt-code-to-report
Nov 24, 2015
bc64c66
Refund Policy on Prof Ed Receipts
Nov 20, 2015
a1f2f39
overriden start and due dates for problems to controll due date of a …
amir-qayyum-khan Oct 21, 2015
bb62577
Merge pull request #10716 from edx/ned/update-i18n-tools
sarina Nov 24, 2015
e16fad3
Add the Microsoft Office Mix XBlock
Dec 16, 2014
e48e250
Merge pull request #10712 from edx/github-capital-h
singingwolfboy Nov 24, 2015
d729e97
Merge pull request #10658 from edx/ahsan/ECOM-2897-Update-help-text-f…
Nov 24, 2015
e534e5d
fix broken report when there is a zero seat invoice
Nov 23, 2015
4f4a089
Merge pull request #6279 from edx/ned/add-officemix-xblock
sarina Nov 24, 2015
7d2aa28
Update translations (autogenerated message)
sarina Nov 24, 2015
0ccb017
Merge pull request #10713 from edx/cdodge/fix-zero-seat-invoices
Nov 24, 2015
7731f3d
Merge pull request #10718 from edx/andya/new-ora-release
andy-armstrong Nov 24, 2015
1b83499
Merge pull request #10619 from mitocw/fix/aq/dates_of_problems
pdpinch Nov 24, 2015
9a361b6
remove unneeded aria-describedby and aria-hidden attrs on studio modal
Nov 18, 2015
29b6ccf
Added new Course List API.
Oct 14, 2015
00ea617
Merge pull request #10721 from edx/sarina/20151124-update-translations
sarina Nov 24, 2015
c8a791a
Merge pull request #10576 from edx/cdyer/course-list-api
jcdyer Nov 24, 2015
0100e50
Merge pull request #10666 from edx/clytwynec/ac-239
Nov 24, 2015
163e6f0
Update config.ini file with new paths
catong Nov 23, 2015
933a2b3
Merge pull request #10715 from edx/carol/doc/StudioHelpUpdates
catong Nov 24, 2015
347bfcb
Merge pull request #10688 from edx/ahsan/ECOM-2562-Refund-Policy-on-P…
Nov 24, 2015
9e2e9af
LMS: adjusting Wiki alert styles
Nov 24, 2015
5043b46
Merge pull request #10602 from edx/peter-fogg/update-footer-config
Nov 24, 2015
fc875b1
Add instructions to github.txt
Nov 24, 2015
9215375
Rewrote Credit API
clintonb Nov 5, 2015
764ceb0
Cert Exceptions: View and Edit Exception list
saleem-latif Nov 17, 2015
996da3d
Merge pull request #10729 from edx/clrux/ac-220
Nov 25, 2015
6ea7c23
MA-1593; include post in comment count
wajeeha-khalid Nov 25, 2015
c474ce6
Merge pull request #10634 from edx/clintonb/credit-api-drf
clintonb Nov 25, 2015
aa529fe
remove audit course mode
ziafazal Nov 25, 2015
984af51
Merge pull request #10656 from edx/saleem-latif/SOL-1390
ziafazal Nov 25, 2015
c5be59d
Disable the pip version check message for uninstalls
Nov 25, 2015
83979f3
Merge pull request #10740 from edx/zoldak/quiet-pip-uninstalls
Nov 25, 2015
ae50d4d
Merge pull request #10730 from edx/ned/github-txt-instructions
nedbat Nov 25, 2015
330120b
MA-1712: Update Mobile API to include course_about
nasthagiri Nov 24, 2015
c6bfac7
Updated credit migration for CreditProvider.provider_id
Nov 25, 2015
70d5732
Add Programs tab to Studio
Nov 10, 2015
1354a0c
Updated edx-organizations version to fix migration related issues
macdiesel Nov 25, 2015
115ab3c
Merge pull request #10720 from edx/mobile/course-about-url-MA-1712
nasthagiri Nov 25, 2015
8f4c226
Merge pull request #10701 from edx/renzo/studio-programs-tab
Nov 25, 2015
35639e7
Merge pull request #10744 from edx/clintonb/credit-migration
clintonb Nov 25, 2015
6e5e185
Merge pull request #10738 from edx/jia/MA-1593
wajeeha-khalid Nov 26, 2015
4615080
Merge pull request #10737 from edx/ziafazal/SOL-1433
ziafazal Nov 26, 2015
2780629
Fixed display name ccx course on coach dashboard
amir-qayyum-khan Oct 30, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@
"spyOnEvent",

// Miscellaneous globals
"JSON"
"JSON",
"gettext"
]
}
2 changes: 0 additions & 2 deletions cms/djangoapps/contentstore/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
""" module init will register signal handlers """
import contentstore.signals
2 changes: 1 addition & 1 deletion cms/djangoapps/contentstore/context_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

def doc_url(request=None): # pylint: disable=unused-argument
"""
This function is added in the list of TEMPLATE_CONTEXT_PROCESSORS, which is a django setting for
This function is added in the list of TEMPLATES 'context_processors' OPTION, which is a django setting for
a tuple of callables that take a request object as their argument and return a dictionary of items
to be merged into the RequestContext.

Expand Down
6 changes: 3 additions & 3 deletions cms/djangoapps/contentstore/courseware_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from six import add_metaclass

from django.conf import settings
from django.utils.translation import ugettext as _
from django.utils.translation import ugettext_lazy, ugettext as _
from django.core.urlresolvers import resolve

from contentstore.utils import course_image_url
Expand Down Expand Up @@ -350,7 +350,7 @@ class CoursewareSearchIndexer(SearchIndexerBase):
'category': 'courseware_index'
}

UNNAMED_MODULE_NAME = _("(Unnamed)")
UNNAMED_MODULE_NAME = ugettext_lazy("(Unnamed)")

@classmethod
def normalize_structure_key(cls, structure_key):
Expand Down Expand Up @@ -417,7 +417,7 @@ def supplemental_fields(cls, item):
while parent is not None:
path_component_name = parent.display_name
if not path_component_name:
path_component_name = cls.UNNAMED_MODULE_NAME
path_component_name = unicode(cls.UNNAMED_MODULE_NAME)
location_path.append(path_component_name)
parent = parent.get_parent()
location_path.reverse()
Expand Down
2 changes: 1 addition & 1 deletion cms/djangoapps/contentstore/features/advanced_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# pylint: disable=redefined-outer-name

from lettuce import world, step
from nose.tools import assert_false, assert_equal, assert_regexp_matches # pylint: disable=no-name-in-module
from nose.tools import assert_false, assert_equal, assert_regexp_matches
from common import type_in_codemirror, press_the_notification_button, get_codemirror_value

KEY_CSS = '.key h3.title'
Expand Down
2 changes: 1 addition & 1 deletion cms/djangoapps/contentstore/features/checklists.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# pylint: disable=redefined-outer-name

from lettuce import world, step
from nose.tools import assert_true, assert_equal # pylint: disable=no-name-in-module
from nose.tools import assert_true, assert_equal
from selenium.common.exceptions import StaleElementReferenceException


Expand Down
2 changes: 1 addition & 1 deletion cms/djangoapps/contentstore/features/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import os
from lettuce import world, step
from nose.tools import assert_true, assert_in # pylint: disable=no-name-in-module
from nose.tools import assert_true, assert_in
from django.conf import settings

from student.roles import CourseStaffRole, CourseInstructorRole, GlobalStaff
Expand Down
2 changes: 1 addition & 1 deletion cms/djangoapps/contentstore/features/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# pylint: disable=unused-argument

from lettuce import world, step
from nose.tools import assert_true, assert_in, assert_equal # pylint: disable=no-name-in-module
from nose.tools import assert_true, assert_in, assert_equal

DISPLAY_NAME = "Display Name"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# pylint: disable=missing-docstring

from lettuce import world
from nose.tools import assert_equal, assert_in # pylint: disable=no-name-in-module
from nose.tools import assert_equal, assert_in
from terrain.steps import reload_the_page
from common import type_in_codemirror
from selenium.webdriver.common.keys import Keys
Expand Down
2 changes: 1 addition & 1 deletion cms/djangoapps/contentstore/features/course-outline.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from lettuce import world, step
from common import *
from nose.tools import assert_true, assert_false # pylint: disable=no-name-in-module
from nose.tools import assert_true, assert_false

from logging import getLogger
logger = getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion cms/djangoapps/contentstore/features/course-settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from common import type_in_codemirror, upload_file
from django.conf import settings

from nose.tools import assert_true, assert_false # pylint: disable=no-name-in-module
from nose.tools import assert_true, assert_false

TEST_ROOT = settings.COMMON_TEST_DATA_ROOT

Expand Down
3 changes: 1 addition & 2 deletions cms/djangoapps/contentstore/features/course-updates.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# pylint: disable=missing-docstring
# pylint: disable=redefined-outer-name

from lettuce import world, step
from selenium.webdriver.common.keys import Keys
from common import type_in_codemirror, get_codemirror_value
from nose.tools import assert_in # pylint: disable=no-name-in-module
from nose.tools import assert_in


@step(u'I go to the course updates page')
Expand Down
2 changes: 1 addition & 1 deletion cms/djangoapps/contentstore/features/grading.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from terrain.steps import reload_the_page
from selenium.common.exceptions import InvalidElementStateException
from contentstore.utils import reverse_course_url
from nose.tools import assert_in, assert_equal, assert_not_equal # pylint: disable=no-name-in-module
from nose.tools import assert_in, assert_equal, assert_not_equal


@step(u'I am viewing the grading settings')
Expand Down
2 changes: 1 addition & 1 deletion cms/djangoapps/contentstore/features/html-editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from collections import OrderedDict

from lettuce import world, step
from nose.tools import assert_in, assert_false, assert_true, assert_equal # pylint: disable=no-name-in-module
from nose.tools import assert_in, assert_false, assert_true, assert_equal
from common import type_in_codemirror, get_codemirror_value

CODEMIRROR_SELECTOR_PREFIX = "$('iframe').contents().find"
Expand Down
2 changes: 1 addition & 1 deletion cms/djangoapps/contentstore/features/pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# pylint: disable=unused-argument

from lettuce import world, step
from nose.tools import assert_equal, assert_in # pylint: disable=no-name-in-module
from nose.tools import assert_equal, assert_in


CSS_FOR_TAB_ELEMENT = "li[data-tab-id='{0}'] input.toggle-checkbox"
Expand Down
2 changes: 1 addition & 1 deletion cms/djangoapps/contentstore/features/problem-editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import json
from lettuce import world, step
from nose.tools import assert_equal, assert_true # pylint: disable=no-name-in-module
from nose.tools import assert_equal, assert_true
from common import type_in_codemirror, open_new_course
from advanced_settings import change_value, ADVANCED_MODULES_KEY
from course_import import import_file
Expand Down
2 changes: 1 addition & 1 deletion cms/djangoapps/contentstore/features/signup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# pylint: disable=redefined-outer-name

from lettuce import world, step
from nose.tools import assert_true, assert_false # pylint: disable=no-name-in-module
from nose.tools import assert_true, assert_false


@step('I fill in the registration form$')
Expand Down
1 change: 0 additions & 1 deletion cms/djangoapps/contentstore/features/textbooks.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# pylint: disable=missing-docstring
# pylint: disable=redefined-outer-name

from lettuce import world, step
from django.conf import settings
Expand Down
2 changes: 1 addition & 1 deletion cms/djangoapps/contentstore/features/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import os
from django.contrib.auth.models import User
from student.models import CourseEnrollment
from nose.tools import assert_equal, assert_not_equal # pylint: disable=no-name-in-module
from nose.tools import assert_equal, assert_not_equal

TEST_ROOT = settings.COMMON_TEST_DATA_ROOT
ASSET_NAMES_CSS = 'td.name-col > span.title > a.filename'
Expand Down
2 changes: 1 addition & 1 deletion cms/djangoapps/contentstore/features/video_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import requests
from lettuce import world, step
from nose.tools import assert_true, assert_equal, assert_in, assert_not_equal # pylint: disable=no-name-in-module
from nose.tools import assert_true, assert_equal, assert_in, assert_not_equal
from terrain.steps import reload_the_page
from django.conf import settings
from common import upload_file, attach_file
Expand Down
2 changes: 1 addition & 1 deletion cms/djangoapps/contentstore/features/video_handout.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# pylint: disable=missing-docstring

from lettuce import world, step
from nose.tools import assert_true # pylint: disable=no-name-in-module
from nose.tools import assert_true
from video_editor import RequestHandlerWithSessionId, success_upload_file


Expand Down
21 changes: 9 additions & 12 deletions cms/djangoapps/contentstore/management/commands/delete_orphans.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,29 @@ class Command(BaseCommand):
help = '''
Delete orphans from a MongoDB backed course. Takes two arguments:
<course_id>: the course id of the course whose orphans you want to delete
|commit|: optional argument. If not provided, will not run task.
|--commit|: optional argument. If not provided, will dry run delete
'''

def handle(self, *args, **options):
if len(args) not in {1, 2}:
raise CommandError("delete_orphans requires one or more arguments: <course_id> |commit|")
def add_arguments(self, parser):
parser.add_argument('course_id')
parser.add_argument('--commit', action='store_true', help='Commit to deleting the orphans')

def handle(self, *args, **options):
try:
course_key = CourseKey.from_string(args[0])
course_key = CourseKey.from_string(options['course_id'])
except InvalidKeyError:
raise CommandError("Invalid course key.")

commit = False
if len(args) == 2:
commit = args[1] == 'commit'

if commit:
if options['commit']:
print 'Deleting orphans from the course:'
deleted_items = _delete_orphans(
course_key, ModuleStoreEnum.UserID.mgmt_command, commit
course_key, ModuleStoreEnum.UserID.mgmt_command, options['commit']
)
print "Success! Deleted the following orphans from the course:"
print "\n".join(deleted_items)
else:
print 'Dry run. The following orphans would have been deleted from the course:'
deleted_items = _delete_orphans(
course_key, ModuleStoreEnum.UserID.mgmt_command, commit
course_key, ModuleStoreEnum.UserID.mgmt_command, options['commit']
)
print "\n".join(deleted_items)
19 changes: 10 additions & 9 deletions cms/djangoapps/contentstore/management/commands/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,24 @@ class Command(BaseCommand):
"""
help = 'Export the specified data directory into the default ModuleStore'

def handle(self, *args, **options):
"Execute the command"
if len(args) != 2:
raise CommandError("export requires two arguments: <course id> <output path>")
def add_arguments(self, parser):
parser.add_argument('course_id')
parser.add_argument('output_path')

def handle(self, *args, **options):
"""Execute the command"""
try:
course_key = CourseKey.from_string(args[0])
course_key = CourseKey.from_string(options['course_id'])
except InvalidKeyError:
try:
course_key = SlashSeparatedCourseKey.from_deprecated_string(args[0])
course_key = SlashSeparatedCourseKey.from_deprecated_string(options['course_id'])
except InvalidKeyError:
raise CommandError("Invalid course_key: '%s'. " % args[0])
raise CommandError("Invalid course_key: '%s'." % options['course_id'])

if not modulestore().get_course(course_key):
raise CommandError("Course with %s key not found." % args[0])
raise CommandError("Course with %s key not found." % options['course_id'])

output_path = args[1]
output_path = options['output_path']

print "Exporting course id = {0} to {1}".format(course_key, output_path)

Expand Down
10 changes: 6 additions & 4 deletions cms/djangoapps/contentstore/management/commands/fix_not_found.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ class Command(BaseCommand):
"""Fix a course's item not found errors"""
help = "Fix a course's ItemNotFound errors"

def add_arguments(self, parser):
parser.add_argument('course_id')

def handle(self, *args, **options):
"Execute the command"
if len(args) != 1:
raise CommandError("requires 1 argument: <course_id>")
"""Execute the command"""
course_id = options.get('course_id', None)

course_key = CourseKey.from_string(args[0])
course_key = CourseKey.from_string(course_id)
# for now only support on split mongo
# pylint: disable=protected-access
owning_store = modulestore()._get_modulestore_for_courselike(course_key)
Expand Down
22 changes: 10 additions & 12 deletions cms/djangoapps/contentstore/management/commands/force_publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,39 +17,37 @@ class Command(BaseCommand):
help = '''
Force publish a course. Takes two arguments:
<course_id>: the course id of the course you want to publish forcefully
commit: do the force publish
--commit: do the force publish

If you do not specify 'commit', the command will print out what changes would be made.
If you do not specify '--commit', the command will print out what changes would be made.
'''

def add_arguments(self, parser):
parser.add_argument('course_key', help="ID of the Course to force publish")
parser.add_argument('--commit', action='store_true', help="Pull updated metadata from external IDPs")

def handle(self, *args, **options):
"""Execute the command"""
if len(args) not in {1, 2}:
raise CommandError("force_publish requires 1 or more argument: <course_id> |commit|")

try:
course_key = CourseKey.from_string(args[0])
course_key = CourseKey.from_string(options['course_key'])
except InvalidKeyError:
raise CommandError("Invalid course key.")

if not modulestore().get_course(course_key):
raise CommandError("Course not found.")

commit = False
if len(args) == 2:
commit = args[1] == 'commit'

# for now only support on split mongo
owning_store = modulestore()._get_modulestore_for_courselike(course_key) # pylint: disable=protected-access
if hasattr(owning_store, 'force_publish_course'):
versions = get_course_versions(args[0])
versions = get_course_versions(options['course_key'])
print "Course versions : {0}".format(versions)

if commit:
if options['commit']:
if query_yes_no("Are you sure to publish the {0} course forcefully?".format(course_key), default="no"):
# publish course forcefully
updated_versions = owning_store.force_publish_course(
course_key, ModuleStoreEnum.UserID.mgmt_command, commit
course_key, ModuleStoreEnum.UserID.mgmt_command, options['commit']
)
if updated_versions:
# if publish and draft were different
Expand Down
3 changes: 2 additions & 1 deletion cms/djangoapps/contentstore/management/commands/import.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
"""
Script for importing courseware from XML format
"""
from optparse import make_option

from django.core.management.base import BaseCommand, CommandError, make_option
from django.core.management.base import BaseCommand, CommandError
from django_comment_common.utils import (seed_permissions_roles,
are_permissions_roles_seeded)
from xmodule.modulestore.xml_importer import import_course_from_xml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

from opaque_keys.edx.locations import SlashSeparatedCourseKey
from django.core.management import CommandError
from contentstore.management.commands.delete_course import Command # pylint: disable=import-error
from contentstore.tests.utils import CourseTestCase # pylint: disable=import-error
from contentstore.management.commands.delete_course import Command
from contentstore.tests.utils import CourseTestCase
from xmodule.modulestore.tests.factories import CourseFactory
from xmodule.modulestore.django import modulestore

Expand Down
Loading