Skip to content

Commit

Permalink
fix: when LDAP servers are down, rendering error pages would raise an…
Browse files Browse the repository at this point in the history
… exception
  • Loading branch information
azmeuk committed Oct 2, 2023
1 parent 7b95fc1 commit 0574460
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion canaille/backends/ldap/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,10 @@ def login_placeholder(cls):
def has_account_lockability(self):
from .ldapobject import LDAPObject

return "pwdEndTime" in LDAPObject.ldap_object_attributes()
try:
return "pwdEndTime" in LDAPObject.ldap_object_attributes()
except ldap.SERVER_DOWN:
return False


def setup_ldap_models(config):
Expand Down

0 comments on commit 0574460

Please sign in to comment.