```python
if not password:
    password = request.session['secondary_password']
settings.DATABASES['ldap']['PASSWORD'] = password
```