Commit Graph

74 Commits

Author SHA1 Message Date
Ned Batchelder
d9dd10dc97 style: code cleanups from Steven Burch (#29292)
* chore: update deprecated import from collections

* chore: remove outdated imports from markdown library

as it hasn't been supported since 2.0.3 and we're on 3.x.
This was deprecated at least as early as 2012!

* docs: add docstring and remove lint-amnesty to markdown plugin

* chore: remove deprecated etree import

* style: remove unnecessary-comprehension for sets

* style: resolve a number of amnestied pylint complaints

Co-authored-by: stvn <stvn@mit.edu>
2021-11-10 07:11:57 -08:00
M. Zulqarnain
834dabb399 feat: New codemods on OpenedX 2 (#28777) 2021-10-28 16:45:53 +05:00
M. Zulqarnain
39b91154fb feat: New codemods on OpenedX 1 (#28776) 2021-10-27 13:07:36 +05:00
Usama Sadiq
9ee8df0980 fix: Remove pylint constraint and fix warnings (#28646) 2021-10-20 23:00:13 +05:00
Feanil Patel
f9a28d1654 fix: Mark user change as expected in LTIToolLaunchView.post
The lti user gets authenticated and logged in as a part of the LTI View
Post.  This results in the request user changing during the request.  We
mark it here so that it does not produce a false alarm in our
SafeSessions middleware.
2021-10-15 10:10:39 -04:00
João Victor Martins
1fc33070c3 docs: Add ADR for LTI tools in content libraries 2021-10-05 10:11:06 -07:00
sarina
0c74d347f7 fix: abstract edX-specific strings 2021-09-19 14:01:20 -04:00
Samuel Walladge
c3e4976d4d fix: crash in retrieving blockstore bundle links
If the bundle is deleted, `blockstore_cache.get_bundle_version_number(bundle_uuid)`
will raise an error.
Catch this error in `get_bundle_links`,
so the REST api doesn't crash with a 500 error when a linked bundle is deleted.
2021-09-15 10:13:07 -07:00
Jawayria
9f63dc16a4 Merge pull request #28608 from edx/jawayria/bom-2767
chore: Removed django.utils.lru_cache
2021-09-03 19:37:39 +05:00
J. Victor Martins
14e2f29516 feat: Make content libraries an LTI 1.3 tool
Offers blockstore-based content through content libraries acting as an
LTI 1.3 tool:

- Content Library support LTI 1.3 launches offering blockstore-based
  content through resource links.

- Content Library support LTI 1.3. AGS, allowing gradebook updates from
  graded assignments.
2021-09-01 11:56:51 -07:00
Jawayria
389bc0d35d chore: Remove django.utils.lru_cache 2021-09-01 13:53:33 +05:00
João Victor Martins
eec7243141 feat: Add API and command to import blocks from courseware
The functionality is exposed by (a.) A RESTful API, and (b.) A
management command. Both are added to Content Libraries V2. They allow
block importing from a local modulestore instance. Additionally, the
command line supports importing blocks from a remote platform instance
through API calls.

Additionally, fixes were added to parts of the system where needed to
properly export blocks to Content Libraries.
2021-08-17 09:35:34 -07:00
Raul Gallegos
24f9568c4e fix: no library context when not found (#27493)
FAL-1848 (OpenCraft)
2021-05-28 13:01:35 -04:00
Usama Sadiq
13ef0c7762 refactor: pyupgrade second iteration (#27462) 2021-05-11 11:25:22 +05:00
Usama Sadiq
2b55959a8e refactor: apply lint-amnesty on existing violations 2021-04-20 23:51:31 +05:00
Jawayria
df06d1312d refactor: Removed unused imports
Removed unused imports from openedx/core/djangoapps/{content_libraries, coursegraph,courseware_api, crawlers, credentials, credit}
2021-04-06 17:07:13 +05:00
Raul Gallegos
0d691623af fix: setting correct i18n_service to blockstore runtime
xblock information was not being translated correctly when using the blockstore runtime. This makes the i18n_service block-specific so it can look for additional i18n files that can be installed with the XBlock
2021-03-31 14:19:01 -05:00
M. Zulqarnain
5d2b0e8346 refactor: pyupgrade in content_libraries and contentserver apps (#26892) 2021-03-17 17:28:23 +05:00
Aarif
ba16e05899 replaced unittest assertions pytest assertions (#26564) 2021-02-19 16:04:32 +05:00
Fox Piacenti
c840e6f9bb Update Library v2 Indexes to work with ElasticSearch 7. Repair blockstore integration tests. (#26230) 2021-02-08 11:55:47 -05:00
M. Zulqarnain
047a5f5f19 BOM-2319 : Pylint amnesty in openedx content apps (#26347)
* pylint amnesty in openedx content apps

Co-authored-by: Jawayria <jawayriahashmi@gmail.com>
2021-02-08 15:51:22 +05:00
Kyle McCormick
d3ef43047e Fix KeyError in v2 Libraries API (#25753) 2020-12-03 09:49:27 -05:00
Kyle McCormick
4dda73d797 [BD-14] Migrate all environments to use database-backed organizations (#25153)
* Install `organizations` app into LMS and Studio non-optionally.
* Add toggle `ORGANIZATIONS_AUTOCREATE` to Studio.
* Remove the `FEATURES["ORGANIZATIONS_APP"]` toggle.
* Use the new `organizations.api.ensure_organization` function to
  either validate or get-or-create organizations, depending
  on the value of `ORGANIZATIONS_AUTOCREATE`,
  when creating course runs and V2 content libraries.
  We'll soon use it for V1 content libraries as well.
* Remove the `util.organizations_helpers` wrapper layer
  that had to exist because `organizations` was an optional app.
* Add `.get_library_keys()` method to the Split modulestore.
* Add Studio management command for backfilling organizations tables
  (`backfill_orgs_and_org_courses`).

For full details, see
https://github.com/edx/edx-organizations/blob/master/docs/decisions/0001-phase-in-db-backed-organizations-to-all.rst

TNL-7646
2020-12-02 13:58:40 -05:00
0x29a
c83a505635 Replace 'multi_db = True' with 'databases = {alias for alias in connections}'
Check this ticket for details: https://code.djangoproject.com/ticket/29513
2020-11-19 14:06:51 +01: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
Fox Piacenti
c181ed57b1 Add ability to filter library blocks by type. Prevent changing types with unpublished changes. (#25368)
Adds the ability to filter v2 library blocks by block type. Also prevents switching the library type when there are unpublished changes/deletes, as this may cause consistency errors.
2020-10-23 10:50:28 -04:00
Fox Piacenti
73adc729d9 Add a license field to libraries. (#25007) 2020-10-05 11:45:36 -04:00
Robert Raposa
f65bf0ed9d Merge pull request #24794 from regisb/regisb/settings-docs
[BD-21] Document settings with annotations
2020-10-01 11:53:39 -04:00
Usman Khalid
571b1f4d17 Enable the i18n service for the Blockstore service. 2020-09-28 09:34:36 -07:00
Fox Piacenti
2c15bbba2d Add type field/constraint to to libraries v2. (#24861) 2020-09-28 10:58:27 -04:00
Régis Behmo
e555d8a571 [BD-21] Document settings with annotations
We introduce the documentation of django settings via code annotations.
This will allow us to produce a human-readable documentatio of all Open
edX settings.
2020-09-28 12:44:36 +02:00
Fox Piacenti
7bc10e0464 Adjustments to library user access API endpoints required by frontend needs. (#24919) 2020-09-25 09:33:32 -04:00
Sid Verma
72b4afe465 Add ADR for content library indexes 2020-09-18 10:25:59 -04:00
Sid Verma
67f3c0343f Simplify and optimize index searching 2020-09-18 10:25:59 -04:00
Sid Verma
f2ed54d72c Add filtering support for list_library_blocks API 2020-09-18 10:25:59 -04:00
Sid Verma
3233fa92d4 Index xblocks in elasticsearch 2020-09-18 10:25:59 -04:00
Sid Verma
735bc412d4 Add elasticsearch tests 2020-09-18 10:25:59 -04:00
Sid Verma
78045115ab Add filtering and search support to library APIs 2020-09-18 10:25:59 -04:00
Braden MacDonald
1c60d5477b Merge PR #24803: [BD-14] BlockLimitReachedError should returns a 400 response instead of 500
https://github.com/edx/edx-platform/pull/24803
2020-08-31 10:39:20 -07:00
Sid Verma
1170a17b5f BlockLimitReachedError should returns a 400 response instead of 500 2020-08-29 01:08:38 +05:30
Sid Verma
4198eba6c1 Add schema version in library indexes, improve reindexing command 2020-08-24 10:45:01 -04:00
Sid Verma
b56f3d601a Add tests for the case when indexing is disabled 2020-08-24 10:45:01 -04:00
Sid Verma
7a3930efe7 Fail to limited metadata if elastic is not available 2020-08-24 10:45:01 -04:00
Sid Verma
1d2fbcc4cc Optimize and paginate list_libraries API, add num_blocks and last_published fields 2020-08-24 10:45:01 -04:00
Sid Verma
8d33a5a3e1 Add indexing support for blockstore content libraries 2020-08-24 10:45:01 -04:00
Manjinder Singh
c76ed6ae45 Extracting plugin app from edx-platform (#24678)
* Moving plugins infrastructure to edx-django-utils
This PR extracts the code that enables plugins in edx-platform and puts it in edx-django-utils. This is done to allow other IDAS to add plugin functionality.
2020-08-12 07:48:53 -04:00
Sid Verma
04bc696661 Fix wrong field name in ManyRelation 2020-07-14 06:03:44 +05:30
Sid Verma
c609451d2e [BD-14] Limit number of blocks allowed in content libraries (#24276)
* Enforce limit on number of blocks allowed in library (blockstore)

* Enforce limit on number of blocks allowed in library (modulestore)

* Changes from review feedback
2020-07-13 15:49:47 -04:00
Aarif
27480cdd2f Removed deprecated future imports 2020-06-23 18:51:43 +05:00
Diana Huang
92b10b564c Update to handle new format of ManyRelation. 2020-05-29 15:01:09 -04:00