Commit 737ebccb by John Eskew

Remove django-simple-history and all HistoricalRecords.

parent 0702df51
...@@ -912,9 +912,6 @@ INSTALLED_APPS = [ ...@@ -912,9 +912,6 @@ INSTALLED_APPS = [
# Common views # Common views
'openedx.core.djangoapps.common_views', 'openedx.core.djangoapps.common_views',
# History tables
'simple_history',
# Database-backed configuration # Database-backed configuration
'config_models', 'config_models',
'waffle', 'waffle',
......
...@@ -14,7 +14,6 @@ from django.db.models.signals import pre_delete, pre_save ...@@ -14,7 +14,6 @@ from django.db.models.signals import pre_delete, pre_save
from django.dispatch import receiver from django.dispatch import receiver
from jsonfield.fields import JSONField from jsonfield.fields import JSONField
from model_utils.models import TimeStampedModel from model_utils.models import TimeStampedModel
from simple_history.models import HistoricalRecords
class Microsite(models.Model): class Microsite(models.Model):
...@@ -115,9 +114,6 @@ class MicrositeOrganizationMapping(models.Model): ...@@ -115,9 +114,6 @@ class MicrositeOrganizationMapping(models.Model):
organization = models.CharField(max_length=63, db_index=True, unique=True) organization = models.CharField(max_length=63, db_index=True, unique=True)
microsite = models.ForeignKey(Microsite, db_index=True) microsite = models.ForeignKey(Microsite, db_index=True)
# for archiving
history = HistoricalRecords()
def __unicode__(self): def __unicode__(self):
"""String conversion""" """String conversion"""
return u'{microsite_key}: {organization}'.format( return u'{microsite_key}: {organization}'.format(
...@@ -155,9 +151,6 @@ class MicrositeTemplate(models.Model): ...@@ -155,9 +151,6 @@ class MicrositeTemplate(models.Model):
template_uri = models.CharField(max_length=255, db_index=True) template_uri = models.CharField(max_length=255, db_index=True)
template = models.TextField() template = models.TextField()
# for archiving
history = HistoricalRecords()
def __unicode__(self): def __unicode__(self):
"""String conversion""" """String conversion"""
return u'{microsite_key}: {template_uri}'.format( return u'{microsite_key}: {template_uri}'.format(
......
...@@ -42,7 +42,6 @@ from eventtracking import tracker ...@@ -42,7 +42,6 @@ from eventtracking import tracker
from model_utils.models import TimeStampedModel from model_utils.models import TimeStampedModel
from opaque_keys.edx.keys import CourseKey from opaque_keys.edx.keys import CourseKey
from pytz import UTC from pytz import UTC
from simple_history.models import HistoricalRecords
from slumber.exceptions import HttpClientError, HttpServerError from slumber.exceptions import HttpClientError, HttpServerError
import dogstats_wrapper as dog_stats_api import dogstats_wrapper as dog_stats_api
...@@ -1027,9 +1026,6 @@ class CourseEnrollment(models.Model): ...@@ -1027,9 +1026,6 @@ class CourseEnrollment(models.Model):
objects = CourseEnrollmentManager() objects = CourseEnrollmentManager()
# Maintain a history of requirement status updates for auditing purposes
history = HistoricalRecords()
# cache key format e.g enrollment.<username>.<course_key>.mode = 'honor' # cache key format e.g enrollment.<username>.<course_key>.mode = 'honor'
COURSE_ENROLLMENT_CACHE_KEY = u"enrollment.{}.{}.mode" # TODO Can this be removed? It doesn't seem to be used. COURSE_ENROLLMENT_CACHE_KEY = u"enrollment.{}.{}.mode" # TODO Can this be removed? It doesn't seem to be used.
......
...@@ -32,7 +32,6 @@ from django.utils.translation import ugettext as _ ...@@ -32,7 +32,6 @@ from django.utils.translation import ugettext as _
from django.utils.translation import ugettext_lazy from django.utils.translation import ugettext_lazy
from model_utils import Choices from model_utils import Choices
from model_utils.models import StatusModel, TimeStampedModel from model_utils.models import StatusModel, TimeStampedModel
from simple_history.models import HistoricalRecords
from course_modes.models import CourseMode from course_modes.models import CourseMode
from lms.djangoapps.verify_student.ssencrypt import ( from lms.djangoapps.verify_student.ssencrypt import (
...@@ -1043,9 +1042,6 @@ class VerificationDeadline(TimeStampedModel): ...@@ -1043,9 +1042,6 @@ class VerificationDeadline(TimeStampedModel):
# overwrite the manual setting of the field. # overwrite the manual setting of the field.
deadline_is_explicit = models.BooleanField(default=False) deadline_is_explicit = models.BooleanField(default=False)
# Maintain a history of changes to deadlines for auditing purposes
history = HistoricalRecords()
ALL_DEADLINES_CACHE_KEY = "verify_student.all_verification_deadlines" ALL_DEADLINES_CACHE_KEY = "verify_student.all_verification_deadlines"
@classmethod @classmethod
......
...@@ -1988,9 +1988,6 @@ INSTALLED_APPS = [ ...@@ -1988,9 +1988,6 @@ INSTALLED_APPS = [
# Common views # Common views
'openedx.core.djangoapps.common_views', 'openedx.core.djangoapps.common_views',
# History tables
'simple_history',
# Database-backed configuration # Database-backed configuration
'config_models', 'config_models',
'waffle', 'waffle',
......
...@@ -14,7 +14,6 @@ from django.db.models.signals import post_save, pre_save ...@@ -14,7 +14,6 @@ from django.db.models.signals import post_save, pre_save
from django.dispatch import receiver from django.dispatch import receiver
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from django_extensions.db.models import TimeStampedModel from django_extensions.db.models import TimeStampedModel
from simple_history.models import HistoricalRecords
from edxmako.shortcuts import render_to_string from edxmako.shortcuts import render_to_string
from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers
...@@ -48,8 +47,6 @@ class ApiAccessRequest(TimeStampedModel): ...@@ -48,8 +47,6 @@ class ApiAccessRequest(TimeStampedModel):
site = models.ForeignKey(Site) site = models.ForeignKey(Site)
contacted = models.BooleanField(default=False) contacted = models.BooleanField(default=False)
history = HistoricalRecords()
@classmethod @classmethod
def has_api_access(cls, user): def has_api_access(cls, user):
"""Returns whether or not this user has been granted API access. """Returns whether or not this user has been granted API access.
......
...@@ -21,7 +21,6 @@ from django.utils.translation import ugettext as _ ...@@ -21,7 +21,6 @@ from django.utils.translation import ugettext as _
from django.utils.translation import ugettext_lazy from django.utils.translation import ugettext_lazy
from jsonfield.fields import JSONField from jsonfield.fields import JSONField
from model_utils.models import TimeStampedModel from model_utils.models import TimeStampedModel
from simple_history.models import HistoricalRecords
from openedx.core.djangoapps.xmodule_django.models import CourseKeyField from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
from request_cache.middleware import RequestCache, ns_request_cached from request_cache.middleware import RequestCache, ns_request_cached
...@@ -437,9 +436,6 @@ class CreditRequirementStatus(TimeStampedModel): ...@@ -437,9 +436,6 @@ class CreditRequirementStatus(TimeStampedModel):
# the grade to users later and to send the information to credit providers. # the grade to users later and to send the information to credit providers.
reason = JSONField(default={}) reason = JSONField(default={})
# Maintain a history of requirement status updates for auditing purposes
history = HistoricalRecords()
class Meta(object): class Meta(object):
unique_together = ('username', 'requirement') unique_together = ('username', 'requirement')
verbose_name_plural = _('Credit requirement statuses') verbose_name_plural = _('Credit requirement statuses')
...@@ -655,8 +651,6 @@ class CreditRequest(TimeStampedModel): ...@@ -655,8 +651,6 @@ class CreditRequest(TimeStampedModel):
default=REQUEST_STATUS_PENDING default=REQUEST_STATUS_PENDING
) )
history = HistoricalRecords()
class Meta(object): class Meta(object):
# Enforce the constraint that each user can have exactly one outstanding # Enforce the constraint that each user can have exactly one outstanding
# request to a given provider. Multiple requests use the same UUID. # request to a given provider. Multiple requests use the same UUID.
......
...@@ -651,7 +651,7 @@ class CreditRequirementApiTests(CreditApiTestBase): ...@@ -651,7 +651,7 @@ class CreditRequirementApiTests(CreditApiTestBase):
api.set_credit_requirements(self.course_key, requirements) api.set_credit_requirements(self.course_key, requirements)
# Satisfy one of the requirements, but not the other # Satisfy one of the requirements, but not the other
with self.assertNumQueries(12): with self.assertNumQueries(11):
api.set_credit_requirement_status( api.set_credit_requirement_status(
user, user,
self.course_key, self.course_key,
...@@ -663,7 +663,7 @@ class CreditRequirementApiTests(CreditApiTestBase): ...@@ -663,7 +663,7 @@ class CreditRequirementApiTests(CreditApiTestBase):
self.assertFalse(api.is_user_eligible_for_credit(user.username, self.course_key)) self.assertFalse(api.is_user_eligible_for_credit(user.username, self.course_key))
# Satisfy the other requirement # Satisfy the other requirement
with self.assertNumQueries(23): with self.assertNumQueries(22):
api.set_credit_requirement_status( api.set_credit_requirement_status(
user, user,
self.course_key, self.course_key,
...@@ -717,7 +717,7 @@ class CreditRequirementApiTests(CreditApiTestBase): ...@@ -717,7 +717,7 @@ class CreditRequirementApiTests(CreditApiTestBase):
# Delete the eligibility entries and satisfy the user's eligibility # Delete the eligibility entries and satisfy the user's eligibility
# requirement again to trigger eligibility notification # requirement again to trigger eligibility notification
CreditEligibility.objects.all().delete() CreditEligibility.objects.all().delete()
with self.assertNumQueries(16): with self.assertNumQueries(15):
api.set_credit_requirement_status( api.set_credit_requirement_status(
user, user,
self.course_key, self.course_key,
...@@ -1048,15 +1048,13 @@ class CreditProviderIntegrationApiTests(CreditApiTestBase): ...@@ -1048,15 +1048,13 @@ class CreditProviderIntegrationApiTests(CreditApiTestBase):
# - 1 query: Look up the user's enrollment date in the course. # - 1 query: Look up the user's enrollment date in the course.
# - 2 query: Look up the user's completion date in the course. # - 2 query: Look up the user's completion date in the course.
# - 1 query: Update the request. # - 1 query: Update the request.
# - 2 queries: Update the history table for the request.
# - 4 Django savepoints # - 4 Django savepoints
with self.assertNumQueries(16): with self.assertNumQueries(14):
request = api.create_credit_request(self.course_key, self.PROVIDER_ID, self.USER_INFO['username']) request = api.create_credit_request(self.course_key, self.PROVIDER_ID, self.USER_INFO['username'])
# - 2 queries: Retrieve and update the request # - 2 queries: Retrieve and update the request
# - 1 query: Update the history table for the request.
uuid = request["parameters"]["request_uuid"] uuid = request["parameters"]["request_uuid"]
with self.assertNumQueries(3): with self.assertNumQueries(2):
api.update_credit_request_status(uuid, self.PROVIDER_ID, "approved") api.update_credit_request_status(uuid, self.PROVIDER_ID, "approved")
with self.assertNumQueries(1): with self.assertNumQueries(1):
......
...@@ -28,7 +28,6 @@ django-pipeline-forgiving==1.0.0 ...@@ -28,7 +28,6 @@ django-pipeline-forgiving==1.0.0
django-pyfs==1.0.7 django-pyfs==1.0.7
django-sekizai>=0.10 django-sekizai>=0.10
django-ses==0.7.1 django-ses==0.7.1
django-simple-history==1.6.3
django-statici18n==1.4.0 django-statici18n==1.4.0
django-storages==1.4.1 django-storages==1.4.1
django-method-override==0.1.0 django-method-override==0.1.0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment