Commit Graph

77 Commits

Author SHA1 Message Date
edX requirements bot
f33f12bbea BOM-2358 : Pyupgrade in dashboard, debug, discussion apps (#26529)
* Python code cleanup by the cleanup-python-code Jenkins job.

This pull request was generated by the cleanup-python-code Jenkins job, which ran
```
cd lms/djangoapps/dashboard; find . -type f -name '*.py' | while read fname; do sed -i 's/  # lint-amnesty, pylint: disable=super-with-arguments//; s/  # lint-amnesty, pylint: disable=import-error, wrong-import-order//; s/  # lint-amnesty, pylint: disable=wrong-import-order//' "$fname"; done; find . -type f -name '*.py' | while read fname; do pyupgrade --exit-zero-even-if-changed --py3-plus --py36-plus --py38-plus "$fname"; done; isort --recursive .
```

The following packages were installed:
`pyupgrade,isort`

* feedback done

Co-authored-by: Zulqarnain <muhammad.zulqarnain@arbisoft.com>
2021-02-22 15:42:21 +05:00
M. Zulqarnain
65cf0db337 BOM-2278 : Pylint amnesty in discussion, dashboard (#26275)
* pylint amnesty in discussion, dashboard
2021-02-03 18:15:14 +05:00
David Ormsbee
ff382578ea Merge pull request #25581 from mitodl/arslanashraf/195-sysadmin-deprecation-warning
SysAdmin: Added deprecation warning for Sysadmin Dashboard
2020-11-25 10:33:24 -05:00
Arslan Ashraf
7344ddb5e3 SysAdmin: Added deprecation warning for Sysadmin Dashboard 2020-11-12 16:54:18 +05:00
Kyle McCormick
151bd13666 Use full names for common.djangoapps imports; warn when using old style (#25477)
* Generate common/djangoapps import shims for LMS
* Generate common/djangoapps import shims for Studio
* Stop appending project root to sys.path
* Stop appending common/djangoapps to sys.path
* Import from common.djangoapps.course_action_state instead of course_action_state
* Import from common.djangoapps.course_modes instead of course_modes
* Import from common.djangoapps.database_fixups instead of database_fixups
* Import from common.djangoapps.edxmako instead of edxmako
* Import from common.djangoapps.entitlements instead of entitlements
* Import from common.djangoapps.pipline_mako instead of pipeline_mako
* Import from common.djangoapps.static_replace instead of static_replace
* Import from common.djangoapps.student instead of student
* Import from common.djangoapps.terrain instead of terrain
* Import from common.djangoapps.third_party_auth instead of third_party_auth
* Import from common.djangoapps.track instead of track
* Import from common.djangoapps.util instead of util
* Import from common.djangoapps.xblock_django instead of xblock_django
* Add empty common/djangoapps/__init__.py to fix pytest collection
* Fix pylint formatting violations
* Exclude import_shims/ directory tree from linting
2020-11-10 07:02:01 -05:00
David Ormsbee
d05c250da3 Merge pull request #25474 from mitodl/umar/sysadmin-190
remove users listing and staff listing download csv from the sysadmin
2020-11-09 09:23:04 -05:00
Kyle McCormick
d1a775d3cd Use full names for lms.djangoapps imports (#25401)
* Use full LMS imports paths in LMS settings and urls modules
* Use full LMS import paths in Studio settings and urls modules
* Import from lms.djangoapps.badges instead of badges
* Import from lms.djangoapps.branding instead of branding
* Import from lms.djangoapps.bulk_email instead of bulk_email
* Import from lms.djangoapps.bulk_enroll instead of bulk_enroll
* Import from lms.djangoapps.ccx instead of ccx
* Import from lms.djangoapps.course_api instead of course_api
* Import from lms.djangoapps.course_blocks instead of course_blocks
* Import from lms.djangoapps.course_wiki instead of course_wiki
* Import from lms.djangoapps.courseware instead of courseware
* Import from lms.djangoapps.dashboard instead of dashboard
* Import from lms.djangoapps.discussion import discussion
* Import from lms.djangoapps.email_marketing instead of email_marketing
* Import from lms.djangoapps.experiments instead of experiments
* Import from lms.djangoapps.gating instead of gating
* Import from lms.djangoapps.grades instead of grades
* Import from lms.djangoapps.instructor_analytics instead of instructor_analytics
* Import form lms.djangoapps.lms_xblock instead of lms_xblock
* Import from lms.djangoapps.lti_provider instead of lti_provider
* Import from lms.djangoapps.mobile_api instead of mobile_api
* Import from lms.djangoapps.rss_proxy instead of rss_proxy
* Import from lms.djangoapps.static_template_view instead of static_template_view
* Import from lms.djangoapps.survey instead of survey
* Import from lms.djangoapps.verify_student instead of verify_student
* Stop suppressing EdxPlatformDeprecatedImportWarnings
2020-11-04 08:48:33 -05:00
Umar Asghar
52ac0e03ae remove users listing and staff listing download csv from the sysadmin 2020-10-29 14:53:51 +05:00
Aarif
6ee2089077 fixed warnings for wrong-import-order 2020-04-08 23:43:06 +05: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
Giovanni Cimolin da Silva
ba4de2f933 Upgrade pymongo and fix issues
This commit upgrades the version of pymongo from 2.x to 3.x, removing usages to deprecated functions usage and fixing tests where necessary.

This version of pymongo supports MongoDB 2.x all the way up to 4.2, and this ensures that the platform will be able to run on a supported MongoDB version in the next release.
2019-12-09 15:43:56 -03:00
Ned Batchelder
efba6e45e8 Finally import courseware properly everywhere to get rid of a warning 2019-09-26 09:40:15 -04:00
aarif
2e7349b04e python 3 fixes
removed pdb statement

quality fixes

quality fixes

test fixes

quality fixes

python 3 fixes

removed pdb statement

quality fixes

quality fixes

test fixes

quality fixes
2019-09-04 16:02:29 +05:00
aarif
61800c619f replaced StringIO imports with import from six
replaced cStringIO and StringIO imports with import from six

fixed StringIO imports

fixed StringIO imports

fixed XSS python-wrap warning
2019-08-08 00:09:16 +05:00
David Ormsbee
99aa4bfd88 Merge pull request #20099 from stvstnfrd/sysadmin/datatable
Cleanup datatable code in sysadmin user tab
2019-05-24 15:42:23 -04:00
Stu Young
c7f6ff14da incr-277 (#20582)
* run python modernize

* run isort

* remove escape import
2019-05-16 13:21:51 -04:00
David Ormsbee
0de369a4e3 Merge pull request #20095 from stvstnfrd/sysadmin/version
Remove unused version from footer
2019-04-25 10:23:42 -04:00
stv
06602b1922 Cleanup datatable code in sysadmin user tab
There is no significant impact to this change;
it's just some general cleanup that I made while cleaning up this file..

We don't need to store these as instance variables,
since we never use them as such.
And since we've already factored out the remaining code from this
initialization method, we can drop it entirely.
2019-04-02 10:21:07 -07:00
David Ormsbee
e712be7892 Merge pull request #20094 from stvstnfrd/sysadmin/user-courses
Remove course listing from user tab of sysadmin
2019-04-01 17:45:26 -04:00
stv
21f79de92f Cache courses list on sysadmin courses page
We were performing this lookup multiple times in the POST handler;
this should increase speed and memory use, which has been problematic
with this feature.
2019-03-29 14:57:04 -07:00
stv
f7b7963193 Remove unused version from footer
I'm not seeing this value ever initialized in `settings`,
or referenced anywhere else in platform, for that matter..
2019-03-29 10:38:18 -07:00
stv
f165f52d88 Remove course listing from user tab of sysadmin
I'm admittedly unclear why we decided to include a listing of _courses_
in the _users_ tab, when this listing is already available via the
_courses_ tab, which is where you'd expect to find it.

Particularly problematic here is the impact this has on page loads..
For instances with a large number of courses [1], pulling and rendering
adds a nontrivial amount of overhead and leads to longer load times.

In our case, this often leads to a page timeout. Since this is the main
landing page for the sysadmin dashboard, it presents the appearance that
the entire dashboard has crashed. In not being able to access the main
page, you can't access any of the other tabs via navigation, unless you
manually enter the URL :\

[1] ~750 courses, in one example
2019-03-29 10:06:19 -07:00
Mike Dikan
2c149ca6be Removing the Deprecated the 'external_auth' package in favor of 'third_party_auth' which is the current recommendation. 2019-03-02 16:06:46 -05:00
stv
25be88932c Handle out-of-memory exception on Sysadmin Courses
We've been running into OoM issues with this functionality while
executing on one of our smaller application servers.
- Sometimes this manifests by preventing the entire page from loading
  (exception during the GET).
- At others, it occurs using the `Delete course from site` functionality
  by breaking during the POST handler. This case is particularly
  frustrating because the course actually is deleted, but looks like it
  may not have been. Internally, this is because the 500 error occurs
  _after_ the course has been successfully deleted, though this is
  opaque to the end-user.

While this doesn't address the underlying memory issue,
it does at least allow the app to recover gracefully.
2019-02-27 11:21:53 -08:00
Matthew Piatetsky
6e81c84d8b fix unicode strings in lms/ part 1 2019-02-05 15:15:02 -05:00
Feanil Patel
4e13a1c2dd Revert "upgrade gunicorn 19.0 and make upgrade"
This reverts commit f6c215ae5b.
2018-10-31 15:01:00 -04:00
nadeemshahzad
f6c215ae5b upgrade gunicorn 19.0 and make upgrade 2018-10-30 10:42:58 +00:00
Amir Qayyum Khan
9124933925 Fixed issue where git logs aren't functioning
Use the course key as the primary key for storing coure import logs in
mongo, instead of the deprecated course key (this only applies to
courses imported via git_import.py).

No effort is made to migrate existing logs, since they are ephemeral.
2018-10-02 21:01:20 +05:00
Squirrel18
4f12be0894 Files changed by modernize and new gitignore type file. 2018-06-25 17:27:51 -05:00
Eric Fischer
b1316290dc Merge pull request #17738 from caesar2164/encode-sysadmin-staffing-profile-name-upstream
Encodes staff profile names as they can be unicode
2018-05-08 13:59:34 -04:00
Bill DeRusha
d1ed33ac23 Update and refactor random password generator 2018-04-13 14:17:21 -04:00
Giulio Gratta
0ffe133f68 Encodes staff profile names as they can be unicode 2018-03-20 14:28:16 -07:00
Jeremy Bowman
d3d6272d8f PLAT-1873 to_deprecated_string() cleanup part 1 2018-01-08 13:51:42 -05:00
cahrens
819a56fee3 Remove usages of deprecated SlashSeparatedCourseKey. 2017-08-14 11:01:00 -04:00
George Song
32deb6a66a Merge pull request #15258 from mreyk/teltek/bugfix/sysadmin-csv-download
Fix sysadmin csv download as unicode
2017-06-26 06:41:39 -07:00
Andy Armstrong
79acb5c5be Reorder LMS imports using isort 2017-06-11 21:48:06 -04:00
mrey
c0b9603074 Fix sysadmin csv download as unicode 2017-06-07 15:41:37 +02:00
Nimisha Asthagiri
fd49f88e08 Moves external_auth from common to openedx/core. 2016-10-07 12:34:22 -04:00
Juanan Pereira
d92e37337a Change fix following pullrequestreview-619682 2016-09-19 22:40:48 +02:00
Juanan Pereira
8ad9bf4ff5 Avoid to use an unsupported '/' operand between two unicode strings 2016-09-15 23:15:41 +02:00
Ned Batchelder
8b1978ba6c Fix unused-import errors 2016-08-03 12:44:41 -04:00
Calen Pennington
cb2ac42426 Use separate git repos for separate TestCases 2016-05-16 13:29:16 -04:00
John Eskew
8a9845c26e Remove ModuleStoreEnum.Type.xml 2016-04-12 11:53:51 -04:00
John Eskew
f6cdcdf52c Remove sysadmin feature to import course from git into XML modulestore. 2016-03-01 11:00:25 -05:00
Ned Batchelder
f5d0f3ff55 Remove useless pylint suppressions 2015-11-22 07:41:19 -05:00
Usman Khalid
6cb62f2697 Rebase upgrade Django to v1.8.5
Please note that this is a squshed commit and the work of:
Symbolist, macdiesel, nedbat, doctoryes, muzaffaryousaf and muhammad-ammar
2015-11-10 15:00:19 -05:00
Ned Batchelder
2a0259095d Change imports from path to use the stablest name.
The old line:

    from path import path

produced pylint errors because of the baroque way that path.py defined
"path".  We tried to get them to change how they defined it, but they
deleted the name instead: https://github.com/jaraco/path.py/issues/102

(Jason then changed his mind, but this is a better way to use path.py,
it avoids the pylint error at least.)
2015-08-27 12:59:25 -04:00
Sarina Canelake
39d3537410 Pylint logging-format-interpolation: Convert logging calls to use %s formatting 2015-07-13 17:33:29 -04:00
cewing
cb431ccb24 MIT CCX: Use CCX Keys: further revisions in response to code review
only require ccx-keys once

get_current_ccx will now expect a CourseKey instance as its argument, and will raise a value error if this expectation is not met.

document reason for local import

add special methods to pass attribute setting and deletion through to the wrapped modulestore

add __setattr__ and __delattr__ per code review, update __init__ to work with new methods

style change per code review

clean up context manager usage as recommended by code review

remove unused code and imports

convert modulestore type tests to use the `get_modulestore_type` api, remove unused imports

code quality: add docstrings

increase coverage for utils tests

fix bug found in testing.

increase test coverage on modulestore wrapper

code quality fixes

code-quality: ignore import error, but mark site for future consideration
2015-06-12 11:20:30 -07:00
cewing
ef4836503f MIT CCX: Use CCX Keys - responses to code review
remove references to middleware that were missed previously

use key apis rather than local implementation of key conversion.  remove local implementationa

remove spurious test for attribute

fix test setUp to avoid unneeded flattening

code quality fixes

add security check ensuring that the coach is coach for *this* CCX.

prevent ccx/deprecated course id problems

1.  do not allow ccx objects to be created if the course id is deprecated
2.  filter out any ccx memberships that involve deprecated course ids (in case there are bad ccxs in the database)

Fix test failures and errors arising from incorrect code path execution

Create context manager to handle unwrapping and restoring ccx values for the modulestore wrapper, employ it throughout modulestore wrapper implementation
2015-06-12 00:01:24 -07:00