feat: Add backfill course tabs management command

Previously, course tabs would only be created once and never try to
update the default tabs again. This leads to an issue if you ever want
to add a new tab. With this command, you can now update the default tabs
for all existing courses and new courses will pick it up upon creation
when CourseTabList.initialize_default is called.
This commit is contained in:
Dillon Dumesnil
2022-03-09 12:27:18 -05:00
parent 50f348b395
commit 61b93d953d
13 changed files with 304 additions and 189 deletions

View File

@@ -85,7 +85,7 @@ class Command(BaseCommand):
dest='show_receivers',
action='store_true',
help=('Display the list of possible receiver functions and exit.')
), # lint-amnesty, pylint: disable=trailing-comma-tuple
)
parser.add_argument(
'--dry-run',
dest='dry_run',
@@ -95,7 +95,7 @@ class Command(BaseCommand):
"expensive modulestore query to find courses, but it will "
"not emit any signals."
)
), # lint-amnesty, pylint: disable=trailing-comma-tuple
)
parser.add_argument(
'--receivers',
dest='receivers',
@@ -141,7 +141,7 @@ class Command(BaseCommand):
"process. However, if you know what you're doing and need to "
"override that behavior, use this flag."
)
), # lint-amnesty, pylint: disable=trailing-comma-tuple
)
parser.add_argument(
'--skip-ccx',
dest='skip_ccx',
@@ -155,12 +155,12 @@ class Command(BaseCommand):
"if you know what you're doing, you can disable this behavior "
"with this flag, so that CCX receivers are omitted."
)
), # lint-amnesty, pylint: disable=trailing-comma-tuple
)
parser.add_argument(
'--args-from-database',
action='store_true',
help='Use arguments from the SimulateCoursePublishConfig model instead of the command line.',
), # lint-amnesty, pylint: disable=trailing-comma-tuple
)
def get_args_from_database(self):
""" Returns an options dictionary from the current SimulateCoursePublishConfig model. """

View File

@@ -62,7 +62,7 @@ class CourseOverviewTestCase(CatalogIntegrationMixin, ModuleStoreTestCase, Cache
None: None,
}
COURSE_OVERVIEW_TABS = {'courseware', 'info', 'textbooks', 'discussion', 'wiki', 'progress'}
COURSE_OVERVIEW_TABS = {'courseware', 'info', 'textbooks', 'discussion', 'wiki', 'progress', 'dates'}
ENABLED_SIGNALS = ['course_deleted', 'course_published']