Squashed commit of the following:
commit88029a4335Author: Jens Langhammer <jens.langhammer@beryju.org> Date: Mon Jul 20 16:55:55 2020 +0200 admin: update to work with new form commit4040eb9619Author: Jens Langhammer <jens.langhammer@beryju.org> Date: Mon Jul 20 16:43:30 2020 +0200 *: remove path-based import from all PropertyMappings commitc9663a08daAuthor: Jens Langhammer <jens.langhammer@beryju.org> Date: Mon Jul 20 16:33:34 2020 +0200 flows: update work with new stages commita3d92ebc0aAuthor: Jens Langhammer <jens.langhammer@beryju.org> Date: Mon Jul 20 16:23:30 2020 +0200 stages/*: remove path-based import from all stages commit6fa825e372Author: Jens Langhammer <jens.langhammer@beryju.org> Date: Mon Jul 20 16:03:55 2020 +0200 providers/*: remove path-based import from all providers commit6aefd072c8Author: Jens Langhammer <jens.langhammer@beryju.org> Date: Mon Jul 20 15:58:48 2020 +0200 policies/*: remove path-based import from all policies commitac2dd3611fAuthor: Jens Langhammer <jens.langhammer@beryju.org> Date: Mon Jul 20 15:11:27 2020 +0200 sources/*: remove path-based import from all sources commit74e628ce9cAuthor: Jens Langhammer <jens.langhammer@beryju.org> Date: Mon Jul 20 14:43:38 2020 +0200 ui: allow overriding of verbose_name commitd4ee18ee32Author: Jens Langhammer <jens.langhammer@beryju.org> Date: Mon Jul 20 14:08:27 2020 +0200 sources/oauth: migrate from discordapp.com to discord.com
This commit is contained in:
		| @ -1,8 +1,9 @@ | ||||
| """passbook LDAP Models""" | ||||
| from typing import Optional | ||||
| from typing import Optional, Type | ||||
|  | ||||
| from django.core.validators import URLValidator | ||||
| from django.db import models | ||||
| from django.forms import ModelForm | ||||
| from django.utils.translation import gettext_lazy as _ | ||||
| from ldap3 import Connection, Server | ||||
|  | ||||
| @ -53,7 +54,10 @@ class LDAPSource(Source): | ||||
|         Group, blank=True, null=True, default=None, on_delete=models.SET_DEFAULT | ||||
|     ) | ||||
|  | ||||
|     form = "passbook.sources.ldap.forms.LDAPSourceForm" | ||||
|     def form(self) -> Type[ModelForm]: | ||||
|         from passbook.sources.ldap.forms import LDAPSourceForm | ||||
|  | ||||
|         return LDAPSourceForm | ||||
|  | ||||
|     _connection: Optional[Connection] = None | ||||
|  | ||||
| @ -85,7 +89,10 @@ class LDAPPropertyMapping(PropertyMapping): | ||||
|  | ||||
|     object_field = models.TextField() | ||||
|  | ||||
|     form = "passbook.sources.ldap.forms.LDAPPropertyMappingForm" | ||||
|     def form(self) -> Type[ModelForm]: | ||||
|         from passbook.sources.ldap.forms import LDAPPropertyMappingForm | ||||
|  | ||||
|         return LDAPPropertyMappingForm | ||||
|  | ||||
|     def __str__(self): | ||||
|         return f"LDAP Property Mapping {self.expression} -> {self.object_field}" | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Jens Langhammer
					Jens Langhammer