This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
2019-10-07 14:33:48 +00:00
|
|
|
"""passbook reputation request forms"""
|
2019-03-03 19:26:25 +00:00
|
|
|
from django import forms
|
2019-10-14 13:00:20 +00:00
|
|
|
from django.utils.translation import gettext_lazy as _
|
2019-03-03 19:26:25 +00:00
|
|
|
|
|
|
|
from passbook.core.forms.policies import GENERAL_FIELDS
|
2019-10-07 14:33:48 +00:00
|
|
|
from passbook.policies.reputation.models import ReputationPolicy
|
2019-03-03 19:26:25 +00:00
|
|
|
|
|
|
|
|
2019-10-07 14:33:48 +00:00
|
|
|
class ReputationPolicyForm(forms.ModelForm):
|
|
|
|
"""Form to edit ReputationPolicy"""
|
2019-03-03 19:26:25 +00:00
|
|
|
|
|
|
|
class Meta:
|
|
|
|
|
2019-10-07 14:33:48 +00:00
|
|
|
model = ReputationPolicy
|
2019-03-03 19:26:25 +00:00
|
|
|
fields = GENERAL_FIELDS + ['check_ip', 'check_username', 'threshold']
|
|
|
|
widgets = {
|
|
|
|
'name': forms.TextInput(),
|
|
|
|
'value': forms.TextInput(),
|
|
|
|
}
|
2019-10-14 13:00:20 +00:00
|
|
|
labels = {
|
|
|
|
'check_ip': _('Check IP'),
|
|
|
|
}
|