Commit 225dc112 authored by Jens Langhammer's avatar Jens Langhammer

ldap: add Source Creation form

parent 08a5c988
# """Supervisr Mod LDAP Forms"""
"""passbook LDAP Forms"""
# from django import forms
# from django.utils.translation import ugettext_lazy as _
from django import forms
# from supervisr.core.forms.settings import SettingsForm
from passbook.admin.forms.source import SOURCE_FORM_FIELDS
from passbook.ldap.models import LDAPSource
class LDAPSourceForm(forms.ModelForm):
"""LDAPSource Form"""
class Meta:
model = LDAPSource
fields = SOURCE_FORM_FIELDS + ['server_uri', 'bind_cn', 'bind_password',
'type', 'domain', 'base_dn', 'create_user', 'reset_password']
# class GeneralSettingsForm(SettingsForm):
# """general settings form"""
# MODE_AUTHENTICATION_BACKEND = 'auth_backend'
......
......@@ -3,8 +3,6 @@
from django.db import models
from django.utils.translation import gettext as _
# from passbook.core.models import (CreatedUpdatedModel, ProductExtension,
# UUIDModel)
from passbook.core.models import Source
......@@ -28,6 +26,8 @@ class LDAPSource(Source):
create_user = models.BooleanField(default=False)
reset_password = models.BooleanField(default=True)
form = 'passbook.ldap.forms.LDAPSourceForm'
class Meta:
verbose_name = _('LDAP Source')
......
......@@ -2,6 +2,7 @@
from django import forms
from passbook.admin.forms.source import SOURCE_FORM_FIELDS
from passbook.oauth_client.models import OAuthSource
......@@ -11,5 +12,6 @@ class OAuthSourceForm(forms.ModelForm):
class Meta:
model = OAuthSource
# pylint: disable=modelform-uses-exclude
exclude = []
fields = SOURCE_FORM_FIELDS + ['provider_type', 'request_token_url', 'authorization_url',
'access_token_url', 'profile_url', 'consumer_key',
'consumer_secret']
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment