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/flows/forms.py

48 lines
1.1 KiB
Python
Raw Normal View History

2019-10-07 14:33:48 +00:00
"""factor forms"""
2020-05-08 16:29:18 +00:00
from django import forms
from django.contrib.admin.widgets import FilteredSelectMultiple
from django.utils.translation import gettext_lazy as _
from passbook.flows.models import Flow, FlowFactorBinding
2019-12-31 11:51:16 +00:00
GENERAL_FIELDS = ["name", "slug", "order", "policies", "enabled"]
2020-05-08 16:29:18 +00:00
class FlowForm(forms.ModelForm):
"""Flow Form"""
class Meta:
model = Flow
fields = [
"name",
"slug",
"designation",
"factors",
"policies",
]
widgets = {
"name": forms.TextInput(),
"factors": FilteredSelectMultiple(_("policies"), False),
}
class FlowFactorBindingForm(forms.ModelForm):
"""FlowFactorBinding Form"""
class Meta:
model = FlowFactorBinding
fields = [
"flow",
"factor",
"re_evaluate_policies",
"order",
"policies",
]
widgets = {
"name": forms.TextInput(),
"factors": FilteredSelectMultiple(_("policies"), False),
}