[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
This commit is contained in:
Kyle McCormick
2020-12-02 13:58:40 -05:00
committed by GitHub
parent f096f5d685
commit 4dda73d797
30 changed files with 475 additions and 291 deletions

View File

@@ -118,12 +118,11 @@ def should_show_debug_toolbar(request):
FEATURES['MILESTONES_APP'] = True
########################### ORGANIZATIONS #################################
# This is disabled for Devstack Studio for developer convenience.
# If it were enabled, then users would not be able to create course runs
# with any arbritrary org slug -- they would have to first make sure that
# the organization exists in the Organization table.
# Note that some production environments (such as studio.edx.org) do enable this flag.
FEATURES['ORGANIZATIONS_APP'] = False
# Although production studio.edx.org disables `ORGANIZATIONS_AUTOCREATE`,
# we purposefully leave auto-creation enabled in Devstack Studio for developer
# convenience, allowing devs to create test courses for any organization
# without having to first manually create said organizations in the admin panel.
ORGANIZATIONS_AUTOCREATE = True
################################ ENTRANCE EXAMS ################################
FEATURES['ENTRANCE_EXAMS'] = True