From 358e39ced06a577350c8bc64a840f26793c7b095 Mon Sep 17 00:00:00 2001 From: "Langhammer, Jens" Date: Mon, 14 Oct 2019 13:57:38 +0200 Subject: [PATCH] core(major): remove action field from policy --- .../migrations/0004_remove_policy_action.py | 17 +++++++++++++++++ passbook/core/models.py | 8 -------- passbook/policies/forms.py | 2 +- 3 files changed, 18 insertions(+), 9 deletions(-) create mode 100644 passbook/core/migrations/0004_remove_policy_action.py diff --git a/passbook/core/migrations/0004_remove_policy_action.py b/passbook/core/migrations/0004_remove_policy_action.py new file mode 100644 index 000000000..8e1b35b0c --- /dev/null +++ b/passbook/core/migrations/0004_remove_policy_action.py @@ -0,0 +1,17 @@ +# Generated by Django 2.2.6 on 2019-10-14 11:56 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('passbook_core', '0003_auto_20191011_0914'), + ] + + operations = [ + migrations.RemoveField( + model_name='policy', + name='action', + ), + ] diff --git a/passbook/core/models.py b/passbook/core/models.py index 55ba9c8f2..82b055d6a 100644 --- a/passbook/core/models.py +++ b/passbook/core/models.py @@ -186,15 +186,7 @@ class Policy(UUIDModel, CreatedUpdatedModel): """Policies which specify if a user is authorized to use an Application. Can be overridden by other types to add other fields, more logic, etc.""" - ACTION_ALLOW = 'allow' - ACTION_DENY = 'deny' - ACTIONS = ( - (ACTION_ALLOW, ACTION_ALLOW), - (ACTION_DENY, ACTION_DENY), - ) - name = models.TextField(blank=True, null=True) - action = models.CharField(max_length=20, choices=ACTIONS) negate = models.BooleanField(default=False) order = models.IntegerField(default=0) timeout = models.IntegerField(default=30) diff --git a/passbook/policies/forms.py b/passbook/policies/forms.py index 19bf89588..bb685e485 100644 --- a/passbook/policies/forms.py +++ b/passbook/policies/forms.py @@ -1,3 +1,3 @@ """General fields""" -GENERAL_FIELDS = ['name', 'action', 'negate', 'order', 'timeout'] +GENERAL_FIELDS = ['name', 'negate', 'order', 'timeout']