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.
authentik/passbook/policies/password/forms.py

35 lines
1 KiB
Python
Raw Normal View History

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 + [
"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(),
"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
}