🚸 — Use ReconnectLDAPObject

This commit is contained in:
Luc Didry 2025-03-18 13:53:46 +01:00
parent 9389e3a005
commit 0a02855e60
No known key found for this signature in database
GPG key ID: EA868E12D0257E3C
2 changed files with 5 additions and 1 deletions

View file

@ -2,6 +2,8 @@
## [Unreleased]
- 🚸 — Use ReconnectLDAPObject
## 0.9.0
Date: 2025-02-18

View file

@ -40,7 +40,9 @@ def get_application() -> FastAPI:
if config.general.ldap is not None:
import ldap
appli.state.ldap = ldap.initialize(config.general.ldap.uri)
appli.state.ldap = ldap.ldapobject.ReconnectLDAPObject(
config.general.ldap.uri, retry_max=5, retry_delay=5
)
@appli.state.manager.user_loader()
async def query_user(user: str) -> None | str | models.User: