sources/saml(minor): fix fields not being shown

This commit is contained in:
Langhammer, Jens 2019-11-07 17:28:59 +01:00
parent 73d4d9dfe0
commit bac8227371
2 changed files with 7 additions and 2 deletions

View File

@ -30,7 +30,7 @@ class OAuthSourceForm(forms.ModelForm):
'consumer_key': forms.TextInput(), 'consumer_key': forms.TextInput(),
'consumer_secret': forms.TextInput(), 'consumer_secret': forms.TextInput(),
'provider_type': forms.Select(choices=MANAGER.get_name_tuple()), 'provider_type': forms.Select(choices=MANAGER.get_name_tuple()),
'policies': FilteredSelectMultiple(_('policies'), False) 'policies': FilteredSelectMultiple(_('policies'), False),
} }
labels = { labels = {
'request_token_url': _('Request Token URL'), 'request_token_url': _('Request Token URL'),

View File

@ -1,7 +1,10 @@
"""passbook SAML SP Forms""" """passbook SAML SP Forms"""
from django import 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
from passbook.providers.saml.utils import CertificateBuilder from passbook.providers.saml.utils import CertificateBuilder
from passbook.sources.saml.models import SAMLSource from passbook.sources.saml.models import SAMLSource
@ -18,7 +21,8 @@ class SAMLSourceForm(forms.ModelForm):
class Meta: class Meta:
model = SAMLSource model = SAMLSource
fields = ['name', 'entity_id', 'idp_url', 'idp_logout_url', 'auto_logout', 'signing_cert'] fields = SOURCE_FORM_FIELDS + ['entity_id', 'idp_url',
'idp_logout_url', 'auto_logout', 'signing_cert']
labels = { labels = {
'entity_id': 'Entity ID', 'entity_id': 'Entity ID',
'idp_url': 'IDP URL', 'idp_url': 'IDP URL',
@ -26,6 +30,7 @@ class SAMLSourceForm(forms.ModelForm):
} }
widgets = { widgets = {
'name': forms.TextInput(), 'name': forms.TextInput(),
'policies': FilteredSelectMultiple(_('policies'), False),
'entity_id': forms.TextInput(), 'entity_id': forms.TextInput(),
'idp_url': forms.TextInput(), 'idp_url': forms.TextInput(),
'idp_logout_url': forms.TextInput(), 'idp_logout_url': forms.TextInput(),