remove reversion

This commit is contained in:
Jens Langhammer 2019-02-16 09:53:32 +01:00
parent 59a15c988f
commit d32699b332
5 changed files with 18 additions and 14 deletions

View File

@ -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"""

View File

@ -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),
),
]

View File

@ -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."""

View File

@ -1,5 +1,4 @@
django>=2.0
django-reversion
django-model-utils
djangorestframework
PyYAML

View File

@ -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',