add timeout field to policy to prevent stuck policies

This commit is contained in:
Jens Langhammer 2019-03-21 14:48:51 +01:00
parent ae3d3d0295
commit 883d439544
3 changed files with 20 additions and 1 deletions

View File

@ -7,7 +7,7 @@ from passbook.core.models import (DebugPolicy, FieldMatcherPolicy,
GroupMembershipPolicy, PasswordPolicy, GroupMembershipPolicy, PasswordPolicy,
WebhookPolicy) WebhookPolicy)
GENERAL_FIELDS = ['name', 'action', 'negate', 'order', ] GENERAL_FIELDS = ['name', 'action', 'negate', 'order', 'timeout']
class FieldMatcherPolicyForm(forms.ModelForm): class FieldMatcherPolicyForm(forms.ModelForm):
"""FieldMatcherPolicy Form""" """FieldMatcherPolicy Form"""

View File

@ -0,0 +1,18 @@
# Generated by Django 2.1.7 on 2019-03-21 12:03
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('passbook_core', '0020_groupmembershippolicy'),
]
operations = [
migrations.AddField(
model_name='policy',
name='timeout',
field=models.IntegerField(default=30),
),
]

View File

@ -220,6 +220,7 @@ class Policy(UUIDModel, CreatedUpdatedModel):
action = models.CharField(max_length=20, choices=ACTIONS) action = models.CharField(max_length=20, choices=ACTIONS)
negate = models.BooleanField(default=False) negate = models.BooleanField(default=False)
order = models.IntegerField(default=0) order = models.IntegerField(default=0)
timeout = models.IntegerField(default=30)
objects = InheritanceManager() objects = InheritanceManager()