2019-10-07 14:33:48 +00:00
|
|
|
"""passbook Policy forms"""
|
|
|
|
|
|
|
|
from django import forms
|
|
|
|
from django.utils.translation import gettext as _
|
|
|
|
|
|
|
|
from passbook.policies.forms import GENERAL_FIELDS
|
|
|
|
from passbook.policies.password.models import PasswordPolicy
|
|
|
|
|
|
|
|
|
|
|
|
class PasswordPolicyForm(forms.ModelForm):
|
|
|
|
"""PasswordPolicy Form"""
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
|
|
|
|
model = PasswordPolicy
|
2019-12-31 11:51:16 +00:00
|
|
|
fields = GENERAL_FIELDS + [
|
2020-07-10 18:43:35 +00:00
|
|
|
"password_field",
|
2019-12-31 11:51:16 +00:00
|
|
|
"amount_uppercase",
|
|
|
|
"amount_lowercase",
|
|
|
|
"amount_symbols",
|
|
|
|
"length_min",
|
|
|
|
"symbol_charset",
|
|
|
|
"error_message",
|
|
|
|
]
|
2019-10-07 14:33:48 +00:00
|
|
|
widgets = {
|
2019-12-31 11:51:16 +00:00
|
|
|
"name": forms.TextInput(),
|
2020-07-10 18:43:35 +00:00
|
|
|
"password_field": forms.TextInput(),
|
2019-12-31 11:51:16 +00:00
|
|
|
"symbol_charset": forms.TextInput(),
|
|
|
|
"error_message": forms.TextInput(),
|
2019-10-07 14:33:48 +00:00
|
|
|
}
|
|
|
|
labels = {
|
2019-12-31 11:51:16 +00:00
|
|
|
"amount_uppercase": _("Minimum amount of Uppercase Characters"),
|
|
|
|
"amount_lowercase": _("Minimum amount of Lowercase Characters"),
|
|
|
|
"amount_symbols": _("Minimum amount of Symbols Characters"),
|
|
|
|
"length_min": _("Minimum Length"),
|
2019-10-07 14:33:48 +00:00
|
|
|
}
|