diff --git a/passbook/audit/models.py b/passbook/audit/models.py index d20637134..bd84ede7d 100644 --- a/passbook/audit/models.py +++ b/passbook/audit/models.py @@ -10,13 +10,11 @@ from django.db import models from django.utils import timezone from django.utils.translation import gettext as _ from ipware import get_client_ip -from reversion import register from passbook.lib.models import CreatedUpdatedModel, UUIDModel LOGGER = getLogger(__name__) -@register() class AuditEntry(UUIDModel): """An individual audit log entry""" diff --git a/passbook/core/migrations/0005_auto_20190216_0853.py b/passbook/core/migrations/0005_auto_20190216_0853.py new file mode 100644 index 000000000..15fd936bd --- /dev/null +++ b/passbook/core/migrations/0005_auto_20190216_0853.py @@ -0,0 +1,18 @@ +# Generated by Django 2.1.7 on 2019-02-16 08:53 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('passbook_core', '0004_auto_20190215_1534'), + ] + + operations = [ + migrations.AlterField( + model_name='factor', + name='type', + field=models.TextField(unique=True), + ), + ] diff --git a/passbook/core/models.py b/passbook/core/models.py index a6aee769f..78c6dbbee 100644 --- a/passbook/core/models.py +++ b/passbook/core/models.py @@ -5,7 +5,6 @@ from random import SystemRandom from time import sleep from uuid import uuid4 -import reversion from django.contrib.auth.models import AbstractUser from django.db import models from django.urls import reverse_lazy @@ -39,7 +38,6 @@ class User(AbstractUser): applications = models.ManyToManyField('Application') groups = models.ManyToManyField('Group') -@reversion.register() class Provider(models.Model): """Application-independent Provider instance. For example SAML2 Remote, OAuth2 Application""" @@ -63,7 +61,6 @@ class RuleModel(UUIDModel, CreatedUpdatedModel): return False return True -@reversion.register() class Factor(RuleModel): """Authentication factor, multiple instances of the same Factor can be used""" @@ -99,7 +96,6 @@ class Application(RuleModel): def __str__(self): return self.name -@reversion.register() class Source(RuleModel): """Base Authentication source, i.e. an OAuth Provider, SAML Remote or LDAP Server""" @@ -123,7 +119,6 @@ class Source(RuleModel): def __str__(self): return self.name -@reversion.register() class UserSourceConnection(CreatedUpdatedModel): """Connection between User and Source.""" @@ -134,7 +129,6 @@ class UserSourceConnection(CreatedUpdatedModel): unique_together = (('user', 'source'),) -@reversion.register() class Rule(UUIDModel, CreatedUpdatedModel): """Rules which specify if a user is authorized to use an Application. Can be overridden by other types to add other fields, more logic, etc.""" @@ -162,7 +156,6 @@ class Rule(UUIDModel, CreatedUpdatedModel): """Check if user instance passes this rule""" raise NotImplementedError() -@reversion.register() class FieldMatcherRule(Rule): """Rule which checks if a field of the User model matches/doesn't match a certain pattern""" @@ -231,7 +224,6 @@ class FieldMatcherRule(Rule): verbose_name = _('Field matcher Rule') verbose_name_plural = _('Field matcher Rules') -@reversion.register() class PasswordPolicyRule(Rule): """Rule to make sure passwords have certain properties""" @@ -266,7 +258,6 @@ class PasswordPolicyRule(Rule): verbose_name_plural = _('Password Policy Rules') -@reversion.register() class WebhookRule(Rule): """Rule that asks webhook""" @@ -302,7 +293,6 @@ class WebhookRule(Rule): verbose_name = _('Webhook Rule') verbose_name_plural = _('Webhook Rules') -@reversion.register() class DebugRule(Rule): """Rule used for debugging the RuleEngine. Returns a fixed result, but takes a random time to process.""" diff --git a/passbook/core/requirements.txt b/passbook/core/requirements.txt index c3989e55a..5f02386d3 100644 --- a/passbook/core/requirements.txt +++ b/passbook/core/requirements.txt @@ -1,5 +1,4 @@ django>=2.0 -django-reversion django-model-utils djangorestframework PyYAML diff --git a/passbook/core/settings.py b/passbook/core/settings.py index 6e794ee6b..e2c5e0da3 100644 --- a/passbook/core/settings.py +++ b/passbook/core/settings.py @@ -60,7 +60,6 @@ INSTALLED_APPS = [ 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', - 'reversion', 'rest_framework', 'rest_framework_swagger', 'passbook.core.apps.PassbookCoreConfig',