Commit Graph

43 Commits

Author SHA1 Message Date
M. Zulqarnain
da970bf215 BOM-2369 (B): Pyupgrade on contentstore/management (#26758)
* pyupgrade on contentstore/management
2021-03-04 14:31:10 +05:00
usamasadiq
7bbde8f0f5 Applied pylint-amnesty 2021-02-08 13:00:22 +05:00
Kyle McCormick
538dbf696b Import CMS code using fully qualified module names
or, using proper the proper Python 3 relative imports
(e.g., 'from .views import x') which are standard and
unambiguous.
2020-10-19 09:34:31 -04:00
Feanil Patel
9cf2f9f298 Run 2to3 -f future . -w
This will remove imports from __future__ that are no longer needed.

https://docs.python.org/3.5/library/2to3.html#2to3fixer-future
2019-12-30 10:35:30 -05:00
Ayub khan
5613797aa8 INCR-336 python3 compatibility 2019-07-09 15:35:33 +05:00
Matthew Piatetsky
7df30938c4 fix unicode strings in cms/ 2019-02-04 13:01:51 -05:00
bmedx
46cb89e55d Fixes to CMS failures in Django 1.11 tests 2018-01-23 14:11:06 -05:00
bmedx
79fe2e6260 CMS management command cleanup for Django 1.11 2017-11-01 10:13:46 -04:00
noraiz-anwar
8bc7ae1466 delete_course command with course keys containing unicode chars 2017-10-12 18:07:04 +05:00
Clinton Blackburn
56eee715c1 Added support for deleting assets to delete_course management command
The command now has an option to delete assets. This is relevant for
users of the split Mongo module store, which does not delete assets by
default.

Additionally, tests and docstrings have been updated.

LEARNER-2460
2017-09-11 08:25:19 -04:00
noraiz-anwar
bac223acad Enhance delete_course management command 2017-06-12 17:51:54 +05:00
Andy Armstrong
ebb04ca396 Reorder Studio imports using isort 2017-05-30 17:00:50 -04:00
stv
8a27ba05e3 Remove outdated comment
The `commit` argument had already been removed from code [1][2][3],
prompted by the django18 upgrade.

[1] https://github.com/edx/edx-platform/pull/10927
[2] 07f015bb57
[3] a4006c8604
2016-09-20 12:21:52 -07:00
Ned Batchelder
2e1238b83e Remove unused imports 2016-04-08 11:23:05 -04:00
Feanil Patel
a4006c8604 Add another test and fix existing tests. 2015-12-10 11:12:53 -05:00
Feanil Patel
07f015bb57 Fix the management command. 2015-12-10 08:29:33 -05:00
Kevin Falcone
e3c66f55e0 Optimize memory and CPU usage.
The print_out_all_courses() routine consumes a ton of memory (2G and
causes noticable mongo usage spikes).  This actually causes other
processes on production boxes to be memory starved and killed
(such as worker children on edge when this was run recently).

The behavior of this script on production is
* Print several hundred courses
* Ask if you want to delete the one you specified
* print several hundred courses minus one
On a sandbox with 5 courses, you could tell by eye that 1 is gone, but
not in production (or even in stage).

The original PLAT-619 ticket for this suggested printing a course
listing on error, but instead it always printed the course listing.
Even in the error case, hundreds of course ids is confusing and obscures
the error message saying that your course_id is invalid.

You should be getting the course id from the UI or from ./manage.py lms
dump_course_ids, not by searching a list.

Adjusted the test accordingly

Remove get_courses_keys
2015-08-31 11:28:26 -04:00
vkaracic
ff6afaf483 Custom error messages for delete course command
This is a fix for
https://openedx.atlassian.net/browse/PLAT-619
added custom CommandError messages for invalid syntax and
invalid course keys.
2015-07-14 15:28:01 +00:00
stv
cf9308144d Fix PEP8: E302 expected 2 blank lines, found 1 2014-11-10 11:00:11 -08:00
Nimisha Asthagiri
f5abef88c2 LMS-2947 remove get_error_courses in Split.
LMS-2950 move delete_course to Mongo.
2014-07-09 21:10:12 -04:00
Calen Pennington
cfcbdc0145 Move to OpaqueKey implementations from the external library
[LMS-2757]
2014-05-29 17:03:35 -04:00
Don Mitchell
84da71d923 Ensure all cms commands accept either deprecated or new syntax for keys
LMS-2712
2014-05-15 17:09:12 -04:00
Calen Pennington
0d88379eeb Make course ids and usage ids opaque to LMS and Studio [partial commit]
This commit adds all of cms.

These keys are now objects with a limited interface, and the particular
internal representation is managed by the data storage layer (the
modulestore).

For the LMS, there should be no outward-facing changes to the system.
The keys are, for now, a change to internal representation only. For
Studio, the new serialized form of the keys is used in urls, to allow
for further migration in the future.

Co-Author: Andy Armstrong <andya@edx.org>
Co-Author: Christina Roberts <christina@edx.org>
Co-Author: David Baumgold <db@edx.org>
Co-Author: Diana Huang <dkh@edx.org>
Co-Author: Don Mitchell <dmitchell@edx.org>
Co-Author: Julia Hansbrough <julia@edx.org>
Co-Author: Nimisha Asthagiri <nasthagiri@edx.org>
Co-Author: Sarina Canelake <sarina@edx.org>

[LMS-2370]
2014-05-07 12:56:43 -04:00
Will Daly
44dad41ede Switch from Rake to Paver 2014-03-25 11:32:19 -04:00
Will Daly
812e71bbbb Revert "Fix sys.path manipulation in pavement.py, with detailed comment"
This reverts commit 544616be4b.
2014-02-24 11:30:40 -05:00
Will Daly
544616be4b Fix sys.path manipulation in pavement.py, with detailed comment
Restore reverted changes from paver part 1
2014-02-18 15:09:07 -05:00
Will Daly
c85c4b22ed Revert "Replace rake functions with python paver functions"
This reverts commit df2e410f2a.
2014-02-14 14:25:28 -05:00
David Glance
df2e410f2a Replace rake functions with python paver functions
Deprecated rake functions issue a warning and then call paver
replacements

Bring Paver commands up to date with master for servers, assets, and docs.
Revert deprecation of quality, tests, and i18n for a future pull request.
Deprecate workspace migration
2014-02-14 11:25:55 -05:00
David Baumgold
fb13bed947 Updating comments and docs for MITx -> edX transition 2013-12-10 13:21:18 -05:00
Chris Dodge
955e54c2e6 refactor some code out of the django-admin entry point into a help function in CMS. Update tests to use new method 2013-09-13 09:07:01 -04:00
Chris Dodge
41be20a000 define a unseeding forums permissions and call into it from delete_course
define a unseeding forums permissions and call into it from delete_course

define a unseeding forums permissions and call into it from delete_course
2013-09-12 14:27:57 -04:00
Calen Pennington
407b02b358 Centralize startup code, and execute in all contexts
Inspired by: http://eldarion.com/blog/2013/02/14/entry-point-hook-django-projects/
Moves startup code to lms.startup and cms.startup, and calls the startup
methods in wsgi.py and manage.py for both projects.
2013-08-27 12:12:20 -04:00
Chris Dodge
61219169d4 change over the modulestore configuration to be a dict and use a property accessor. Also update some django-admin configs to use this means to set the runtime configuration 2013-08-15 22:58:04 -04:00
ichuang
03bcd19b8d catch error in delete_course management script when group does not exist 2013-08-13 08:46:21 -04:00
Chris Dodge
f57b02c199 add a metadata cache and re-compute ignore when deleting a course to speed up the whole thing as well as squelching warnings in the console output 2013-08-02 22:19:59 -04:00
Chris Dodge
b4fe23f3a2 more cleanups in CMS project 2013-04-13 21:13:34 -04:00
Calen Pennington
6b64b4214f Make relative imports explicitly relative 2013-03-15 11:23:22 -04:00
Ned Batchelder
97f1e04282 Fix some 2-space indents 2013-03-04 10:57:25 -05:00
Chris Dodge
20540fbc2d update usage feedback 2013-03-01 15:52:27 -05:00
Chris Dodge
816b0edfb0 add another command line argument to allow users to only simulate a delete (i.e. show what items would be deleted). This is a handy sanity checker. 2013-02-25 16:00:35 -05:00
Calen Pennington
cfae1cdf62 Pep8 autofixes 2013-02-06 11:13:50 -05:00
Chris Dodge
28d9827468 fix up some thumbnail issues. Also we need to manage the user permissions when we clone and delete course 2012-12-27 10:20:28 -05:00
Chris Dodge
b40a8a3e9e implement course clone and delete functionality from the command line 2012-12-20 13:55:15 -05:00