diff --git a/passbook/core/forms/applications.py b/passbook/core/forms/applications.py index 47693fea5..254c999e6 100644 --- a/passbook/core/forms/applications.py +++ b/passbook/core/forms/applications.py @@ -1,5 +1,6 @@ """passbook Core Application forms""" from django import forms +from django.contrib.admin.widgets import FilteredSelectMultiple from django.utils.translation import gettext_lazy as _ from passbook.core.models import Application, Provider @@ -20,6 +21,7 @@ class ApplicationForm(forms.ModelForm): 'name': forms.TextInput(), 'launch_url': forms.TextInput(), 'icon_url': forms.TextInput(), + 'policies': FilteredSelectMultiple(_('policies'), False) } labels = { 'launch_url': _('Launch URL'), diff --git a/passbook/core/forms/factors.py b/passbook/core/forms/factors.py index 11d0061c6..79d52d0ed 100644 --- a/passbook/core/forms/factors.py +++ b/passbook/core/forms/factors.py @@ -1,5 +1,7 @@ """passbook administration forms""" from django import forms +from django.contrib.admin.widgets import FilteredSelectMultiple +from django.utils.translation import gettext as _ from passbook.core.models import DummyFactor, PasswordFactor from passbook.lib.fields import DynamicArrayField @@ -16,6 +18,7 @@ class PasswordFactorForm(forms.ModelForm): widgets = { 'name': forms.TextInput(), 'order': forms.NumberInput(), + 'policies': FilteredSelectMultiple(_('policies'), False) } field_classes = { 'backends': DynamicArrayField @@ -31,4 +34,5 @@ class DummyFactorForm(forms.ModelForm): widgets = { 'name': forms.TextInput(), 'order': forms.NumberInput(), + 'policies': FilteredSelectMultiple(_('policies'), False) } diff --git a/passbook/core/forms/groups.py b/passbook/core/forms/groups.py index 4f2052623..3a776cd17 100644 --- a/passbook/core/forms/groups.py +++ b/passbook/core/forms/groups.py @@ -1,8 +1,8 @@ """passbook Core Group forms""" from django import forms +from django.contrib.admin.widgets import FilteredSelectMultiple from passbook.core.models import Group, User -from django.contrib.admin.widgets import FilteredSelectMultiple class GroupForm(forms.ModelForm): diff --git a/passbook/hibp_policy/forms.py b/passbook/hibp_policy/forms.py index 08254a53b..643bf4791 100644 --- a/passbook/hibp_policy/forms.py +++ b/passbook/hibp_policy/forms.py @@ -1,6 +1,8 @@ """passbook HaveIBeenPwned Policy forms""" from django import forms +from django.contrib.admin.widgets import FilteredSelectMultiple +from django.utils.translation import gettext as _ from passbook.core.forms.policies import GENERAL_FIELDS from passbook.hibp_policy.models import HaveIBeenPwendPolicy @@ -16,4 +18,5 @@ class HaveIBeenPwnedPolicyForm(forms.ModelForm): widgets = { 'name': forms.TextInput(), 'order': forms.NumberInput(), + 'policies': FilteredSelectMultiple(_('policies'), False) } diff --git a/passbook/ldap/forms.py b/passbook/ldap/forms.py index cb47328c1..b16658886 100644 --- a/passbook/ldap/forms.py +++ b/passbook/ldap/forms.py @@ -1,6 +1,7 @@ """passbook LDAP Forms""" from django import forms +from django.contrib.admin.widgets import FilteredSelectMultiple from django.utils.translation import gettext_lazy as _ from passbook.admin.forms.source import SOURCE_FORM_FIELDS @@ -23,6 +24,7 @@ class LDAPSourceForm(forms.ModelForm): 'bind_password': forms.TextInput(), 'domain': forms.TextInput(), 'base_dn': forms.TextInput(), + 'policies': FilteredSelectMultiple(_('policies'), False) } labels = { 'server_uri': _('Server URI'), diff --git a/passbook/oauth_client/forms.py b/passbook/oauth_client/forms.py index 6187f4869..cd9036316 100644 --- a/passbook/oauth_client/forms.py +++ b/passbook/oauth_client/forms.py @@ -1,6 +1,7 @@ """passbook oauth_client forms""" from django import forms +from django.contrib.admin.widgets import FilteredSelectMultiple from django.utils.translation import gettext as _ from passbook.admin.forms.source import SOURCE_FORM_FIELDS @@ -29,6 +30,7 @@ class OAuthSourceForm(forms.ModelForm): 'consumer_key': forms.TextInput(), 'consumer_secret': forms.TextInput(), 'provider_type': forms.Select(choices=MANAGER.get_name_tuple()), + 'policies': FilteredSelectMultiple(_('policies'), False) } labels = { 'request_token_url': _('Request Token URL'), diff --git a/passbook/otp/forms.py b/passbook/otp/forms.py index 52c00b3d2..bfe41e0bc 100644 --- a/passbook/otp/forms.py +++ b/passbook/otp/forms.py @@ -1,6 +1,7 @@ """passbook OTP Forms""" from django import forms +from django.contrib.admin.widgets import FilteredSelectMultiple from django.core.validators import RegexValidator from django.utils.safestring import mark_safe from django.utils.translation import ugettext_lazy as _ @@ -63,4 +64,5 @@ class OTPFactorForm(forms.ModelForm): widgets = { 'name': forms.TextInput(), 'order': forms.NumberInput(), + 'policies': FilteredSelectMultiple(_('policies'), False) } diff --git a/passbook/password_expiry_policy/forms.py b/passbook/password_expiry_policy/forms.py index cd957af0a..be496cd0b 100644 --- a/passbook/password_expiry_policy/forms.py +++ b/passbook/password_expiry_policy/forms.py @@ -1,6 +1,7 @@ """passbook PasswordExpiry Policy forms""" from django import forms +from django.contrib.admin.widgets import FilteredSelectMultiple from django.utils.translation import gettext as _ from passbook.core.forms.policies import GENERAL_FIELDS @@ -18,6 +19,7 @@ class PasswordExpiryPolicyForm(forms.ModelForm): 'name': forms.TextInput(), 'order': forms.NumberInput(), 'days': forms.NumberInput(), + 'policies': FilteredSelectMultiple(_('policies'), False) } labels = { 'deny_only': _("Only fail the policy, don't set user's password.") diff --git a/passbook/saml_idp/forms.py b/passbook/saml_idp/forms.py index e54bd6306..d305b2990 100644 --- a/passbook/saml_idp/forms.py +++ b/passbook/saml_idp/forms.py @@ -1,6 +1,8 @@ """passbook SAML IDP Forms""" from django import forms +from django.contrib.admin.widgets import FilteredSelectMultiple +from django.utils.translation import gettext as _ from passbook.lib.fields import DynamicArrayField from passbook.saml_idp.models import (SAMLPropertyMapping, SAMLProvider, @@ -32,6 +34,7 @@ class SAMLProviderForm(forms.ModelForm): widgets = { 'name': forms.TextInput(), 'issuer': forms.TextInput(), + 'property_mappings': FilteredSelectMultiple(_('Property Mappings'), False) }