Commits

Matthew J Little committed fca6c12

correct issue with the ldap checkbox not being set with the current value of ldap_active when rendering the page

Comments (0)

Files changed (2)

rhodecode/controllers/admin/ldap_settings.py

 
 from sqlalchemy.exc import DatabaseError
 
+from rhodecode.lib import str2bool
 from rhodecode.lib.base import BaseController, render
 from rhodecode.lib import helpers as h
 from rhodecode.lib.auth import LoginRequired, HasPermissionAllDecorator
         c.search_scope_cur = defaults.get('ldap_search_scope')
         c.tls_reqcert_cur = defaults.get('ldap_tls_reqcert')
         c.tls_kind_cur = defaults.get('ldap_tls_kind')
-
+        
+        defaults.update({'ldap_active':str2bool(defaults.get('ldap_active'))})
+                        
         return htmlfill.render(
                     render('admin/ldap/ldap.html'),
                     defaults=defaults,

rhodecode/templates/admin/ldap/ldap.html

 	  <h3>${_('Connection settings')}</h3>
             <div class="field">
                 <div class="label label-checkbox"><label for="ldap_active">${_('Enable LDAP')}</label></div>
-                <div class="checkboxes"><div class="checkbox">${h.checkbox('ldap_active','true',class_='small')}</div></div>
+                <div class="checkboxes"><div class="checkbox">${h.checkbox('ldap_active',True,class_='small')}</div></div>
             </div>
             <div class="field">
                 <div class="label"><label for="ldap_host">${_('Host')}</label></div>