Commit Graph

10 Commits

Author SHA1 Message Date
Usama Sadiq
7e275ec3ca refactor: ran pyupgrade on lms/djangoapps (#26523)
ran pyupgrade on course_Wiki, coursewarehistoryextended
2021-03-09 12:49:44 +05:00
Christian Clauss
1496ce1efb Undefined name: import datetime for line 30
Without this change, line 30 will raise NameError at runtime.
2020-01-02 19:23:43 +01: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
Ned Batchelder
efba6e45e8 Finally import courseware properly everywhere to get rid of a warning 2019-09-26 09:40:15 -04:00
Cory Lee
8eddb822ab Refactor CSME id, CSMH_EXTENDED default true 2019-08-27 16:47:47 -04:00
Stu Young
3725595a62 INCR-288 Run python-modernize on lms/djangoapps/coursewarehistoryextended (#20595)
* run python modernize

* run isort
2019-05-21 11:21:45 -04:00
Jeremy Bowman
d622380cc5 Account for Django block on DDL in transactions 2018-04-02 11:47:54 -04:00
Kevin Falcone
304fb68076 Despite db_index=True, Django didn't generate an index
student_module_id is the primary way into this table, not having an
index is disastrous with real data.
2016-03-03 15:27:21 -05:00
Kevin Falcone
b4ac588ce1 Update reset-test-db.sh for bok-choy
This now correctly migrates and dumps files for both databases.

Run lettuce migrations for both databases
2016-02-29 13:59:29 -05:00
Kevin Falcone
6f9a3911e5 Implement a BaseStudentModuleHistory
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.
2016-02-29 13:59:27 -05:00