This abstract class contains most of the fields (aside from the id and
foreign key to StudentModule that the subclasses need to manage). It
also provides a get_history method that abstracts searching across
multiple backends.
Move router code to openedx/core
We need to use it from cms and lms.
Ensure aws_migrate can be used for migrating both the lms and cms.
Handle queries directed to student_module_history vs default and the
extra queries generated by Django 1.8 (SAVEPOINTS, etc).
Additionally, flag testing classes as multi_db so that Django will
flush the non-default database between unit tests.
Further decouple the foreignkey relation between csm and csmhe
When calling StudentModule().delete() Django will try to delete CSMHE
objects, but naively does so in the database, not by consulting the
database router.
Instead, we disable django cascading deletes and listen for post_delete
signals and clean up CSMHE by hand.
Add feature flags for CSMHE
One to turn it on/off so we can control the deploy.
The other will control whether or not we read from two database tables
or one when searching.
Update tests to explicitly use this get_history method rather than
looking directly into StudentModuleHistory or
StudentModuleHistoryExtended.
Inform lettuce to avoid the coursewarehistoryextended app
Otherwise it fails when it can't find features/ in that app.
Add Pg support, this is not tested automatically.
This is a clone (copy) of CSMH's declaration and methods with an added
id of UnsignedBigInAutoField
We should be able to delete the save_history code, but needs testing.
Add error logging when capa failures happen
Put StudentModuleHistory into its own database
Bump out the primary key on CSMHE
This gives us a gap to backfill as needed.
Since the new table's pk is an unsigned bigint, even for people who don't
consolidate CSMH into CSMHE, the lost rows are unlikely to matter.
Remove StudentModuleHistory cleaner
By default, migrations are applied as they always have been. Exporting DISABLE_MIGRATIONS=1 or passing --disable-migrations to Paver commands will create tables directly from apps' models.
Collectstatic failed in production when comprehensive theme contained custom css files.
This patch fixes that problem by removing ComprehensiveThemeFinder from STATICFILES_FINDERS
and ComprehensiveThemingAware mixin from STATICFILES_STORAGE.
Comprehensive theme static dirs are added to the top of the STATICFILES_DIRS entry,
which means that the default django FilesystemFinder will find theme static files,
and since the theme folder is at the top of STATICFILES_DIRS, theme files will take
precedence over default LMS/CMS static files.
This change means that theme static file URLs are no longer prefixed with themes/<theme-name>/,
but since we currently only support one comprehensive theme at a time, that shouldn't be a problem.
If/when we want to make the choice of a theme dynamic per-request (microsites?), we will have to
bring custom theme finders and storage mixins back, but for now, we don't need them.
This introduces a mechanism to control the time-to-live for an unlocked
course asset, which will allow browsers and intermediate proxies/caches
to cache these course assets, determinstically.
Locked assets, with their nature of requiring authorization, are not
eligible for caching.
Adding the declaration of the settings object to openedx.conf to be able to import it from a nicer location
Resolving quality violations
Merging dicts with the settings definition when they exist in the microsite configuration
Using a cache to improve the perfomance of quering any dictionary in the microsite definition
Ignoring the invalid-name pylint warning since the names must be kept thsi way to stay the same as the ones in django.
Removing the default dict argument as per https://docs.python.org/2/tutorial/controlflow.html#default-argument-values
Extracting the implementation of the microsite to a selectable backend.
Leaving the function startup.enable_microsites for backwards compatibilityy
Adding a database backend
Using a cache to improve the perfomance of quering any dictionary in the microsite definition.
Changed the database backend so that it extends the settings file backend and removed all the unnecessary methods.
Using the backend provider for the get_dict function
some tweeks and some initial unit tests
Using getattr as a function insteal of calling the underlying __getattr__ directly
Adding an ModelAdmin object for the microsite model in the django-admin panel
refactor enable_microsites()
consolidate/refactor some shared code
add config to aws.py and add migration files
fix tests
Changes to get the backends to run after the refactor
add archiving capabilities to microsites. Also make a few notes about performance improvements to make
fix tests
Making the query to find if microsites exist in the database faster
add ORG to microsite mapping tables and some performance improvements
allow for Mako templates to be pulled from the database
fix tests
For the database template backend the uri of the template does not use the filesystem relative path
Fixing pylint violations
Added caching of the templates stored in the database
Fixing pylint errors
fix pylint
Clearing the cache on model save
Fixing pylint errors
rebased and added test coverage
rebased cdodge/microsite-improvements branch with master and added test
coverage
added missing migration
fix quality violations
add more test coverage
mattdrayer: Add microsite_configuration to cms.INSTALLED_APPS
added microsite settings to cms/envs/test.py
run session cookie tests only in LMS
fixed broken tests
putting middleware changes back
Preventing the template_backend to be called on requests which have no microsite
changes to address feedback from mjfrey
changed BaseMicrositeBackend to AbstractBaseMicrositeBackend
changes after feedback from mattdrayer
fixed broken tests and quality violations
Allowing the backend to handle the enable_pre_startup routine
Typos and docstrings
Adressing feedback
Fixing python tests
add comment to explain why we need enable_microsites_pre_startup()