[sagenb] 07/179: only display LDAP settings if python-ldap is installed
felix salfelder
felix-guest at moszumanska.debian.org
Tue May 6 12:05:04 UTC 2014
This is an automated email from the git hooks/post-receive script.
felix-guest pushed a commit to branch master
in repository sagenb.
commit f40903be660343d570f4d32a3329e8e148bc8463
Author: Robin Martinjak <rob at rmartinjak.de>
Date: Wed Jun 20 22:24:04 2012 +0200
only display LDAP settings if python-ldap is installed
---
sagenb/notebook/conf.py | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/sagenb/notebook/conf.py b/sagenb/notebook/conf.py
index d3da2e4..a6510db 100644
--- a/sagenb/notebook/conf.py
+++ b/sagenb/notebook/conf.py
@@ -126,6 +126,12 @@ class Configuration(object):
return updated
def html_table(self, updated = {}):
+ from server_conf import G_LDAP
+ try:
+ from ldap import __version__ as ldap_version
+ except ImportError:
+ ldap_version = None
+
# For now, we assume there's a description for each setting.
D = self.defaults()
DS = self.defaults_descriptions()
@@ -137,6 +143,8 @@ class Configuration(object):
for key in K:
try:
gp = DS[key][GROUP]
+ if gp == G_LDAP and ldap_version is None:
+ continue
DS[key][DESC]
DS[key][TYPE]
except KeyError:
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/sagenb.git
More information about the debian-science-commits
mailing list