def _get_or_create_user(self, force_populate=False):
save_user = False<EOL>username = self.backend.ldap_to_django_username(self._username)<EOL>self._user, created = self.backend.get_or_create_user(username, self)<EOL>self._user.ldap_user = self<EOL>self._user.ldap_username = self._username<EOL>should_populate = force_populate or self.settings.ALWAYS_UPDATE_USER or created<EOL>if created:<EOL><INDENT>logger.debug("<STR_LIT>", username)<EOL>self._user.set_unusable_password()<EOL>save_user = True<EOL><DEDENT>if should_populate:<EOL><INDENT>logger.debug("<STR_LIT>", username)<EOL>self._populate_user()<EOL>save_user = True<EOL><DEDENT>if self.settings.MIRROR_GROUPS:<EOL><INDENT>self._mirror_groups()<EOL><DEDENT>if should_populate:<EOL><INDENT>signal_responses = populate_user.send(self.backend.__class__, user=self._user, ldap_user=self)<EOL>if len(signal_responses) > <NUM_LIT:0>:<EOL><INDENT>save_user = True<EOL><DEDENT><DEDENT>if save_user:<EOL><INDENT>self._user.save()<EOL><DEDENT>if should_populate and self._should_populate_profile():<EOL><INDENT>self._populate_and_save_user_profile()<EOL><DEDENT>
Loads the User model object from the database or creates it if it
doesn't exist. Also populates the fields, subject to
AUTH_LDAP_ALWAYS_UPDATE_USER.