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-03-03 16:12:05 +00:00
|
|
|
"""passbook PasswordExpiry Policy forms"""
|
|
|
|
|
|
|
|
from django import forms
|
|
|
|
from django.utils.translation import gettext as _
|
|
|
|
|
2019-10-07 14:33:48 +00:00
|
|
|
from passbook.policies.expiry.models import PasswordExpiryPolicy
|
2020-05-10 00:14:55 +00:00
|
|
|
from passbook.policies.forms import GENERAL_FIELDS
|
2019-03-03 16:12:05 +00:00
|
|
|
|
|
|
|
|
|
|
|
class PasswordExpiryPolicyForm(forms.ModelForm):
|
|
|
|
"""Edit PasswordExpiryPolicy instances"""
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
|
|
|
|
model = PasswordExpiryPolicy
|
2019-12-31 11:51:16 +00:00
|
|
|
fields = GENERAL_FIELDS + ["days", "deny_only"]
|
2019-03-03 16:12:05 +00:00
|
|
|
widgets = {
|
2019-12-31 11:51:16 +00:00
|
|
|
"name": forms.TextInput(),
|
|
|
|
"order": forms.NumberInput(),
|
|
|
|
"days": forms.NumberInput(),
|
2019-03-03 16:12:05 +00:00
|
|
|
}
|
2019-12-31 11:51:16 +00:00
|
|
|
labels = {"deny_only": _("Only fail the policy, don't set user's password.")}
|