def _search_for_user_dn(self):
search = self.settings.USER_SEARCH<EOL>if search is None:<EOL><INDENT>raise ImproperlyConfigured('<STR_LIT>')<EOL><DEDENT>results = search.execute(self.connection, {'<STR_LIT:user>': self._username})<EOL>if results is not None and len(results) == <NUM_LIT:1>:<EOL><INDENT>(self._user_dn, self._user_attrs) = next(iter(results))<EOL><DEDENT>
Searches the directory for a user matching AUTH_LDAP_USER_SEARCH.
Populates self._user_dn and self._user_attrs.