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
|
|
|
|
2020-05-10 00:14:55 +00:00
|
|
|
from passbook.policies.forms 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-12-31 11:51:16 +00:00
|
|
|
fields = GENERAL_FIELDS + ["check_ip", "check_username", "threshold"]
|
2019-03-03 19:26:25 +00:00
|
|
|
widgets = {
|
2019-12-31 11:51:16 +00:00
|
|
|
"name": forms.TextInput(),
|
|
|
|
"value": forms.TextInput(),
|
2019-03-03 19:26:25 +00:00
|
|
|
}
|
2019-10-14 13:00:20 +00:00
|
|
|
labels = {
|
2019-12-31 11:51:16 +00:00
|
|
|
"check_ip": _("Check IP"),
|
2019-10-14 13:00:20 +00:00
|
|
|
}
|