authentik/passbook/policies/hibp/forms.py

23 lines
683 B
Python
Raw Normal View History

"""passbook HaveIBeenPwned Policy forms"""
from django import forms
from django.contrib.admin.widgets import FilteredSelectMultiple
from django.utils.translation import gettext as _
from passbook.policies.forms import GENERAL_FIELDS
2019-10-07 15:33:48 +01:00
from passbook.policies.hibp.models import HaveIBeenPwendPolicy
class HaveIBeenPwnedPolicyForm(forms.ModelForm):
"""Edit HaveIBeenPwendPolicy instances"""
class Meta:
model = HaveIBeenPwendPolicy
2019-12-31 11:51:16 +00:00
fields = GENERAL_FIELDS + ["allowed_count"]
widgets = {
2019-12-31 11:51:16 +00:00
"name": forms.TextInput(),
"order": forms.NumberInput(),
"policies": FilteredSelectMultiple(_("policies"), False),
}