code: def _save_account(self, account, username):
          
  
          # retrieve default project, or use null project if none
          default_project_name = self._null_project
          if account.default_project is not None:
              default_project_name = account.default_project.pid
  
          # account created
          # account updated
  
          ds_user = self.get_user(username)
          if account.date_deleted is None:
              # date_deleted is not set, user should exist
              logger.debug("account is active")
  
              if ds_user is None:
                  # create user if doesn't exist
                  self._create_user(username, default_project_name)
              else:
                  # or just set default project
                  self._set_user_default_project(username, default_project_name)
  
              # update user meta information
              self._call([
                  "gchuser",
                  "-n", self._filter_string(account.person.get_full_name()),
                  "-u", username])
              self._call([
                  "gchuser",
                  "-E", self._filter_string(account.person.email),
                  "-u", username])
  
              # add rest of projects user belongs to
              mam_projects = self.get_projects_in_user(username)
              for project in account.person.projects.all():
                  if project.pid not in mam_projects:
                      self.add_account_to_project(account, project)
          else:
              # date_deleted is not set, user should not exist
              logger.debug("account is not active")
              if ds_user is not None:
                  # delete MAM user if account marked as deleted
                  self._call(["grmuser", "-u", username], ignore_errors=[8])
  
          return
docs: Called when account is created/updated. With username override.