<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 07/16/2015 06:43 PM, Mads Kiilerich
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAJ6fcO4weJ2Qgi+5azrV+8Y0w0hg3eFkjh8V4=TOOqfyG9qCEw@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">On Tue, Jun 30, 2015 at 10:43 PM,
            Thomas De Schampheleire <span dir="ltr"><<a
                moz-do-not-send="true"
                href="mailto:patrickdepinguin@gmail.com" target="_blank">patrickdepinguin@gmail.com</a>></span>
            wrote:<br>
            <blockquote class="gmail_quote" style="margin:0 0 0
              .8ex;border-left:1px #ccc solid;padding-left:1ex"># HG
              changeset patch<br>
              # User Thomas De Schampheleire <<a
                moz-do-not-send="true"
                href="mailto:thomas.de.schampheleire@gmail.com">thomas.de.schampheleire@gmail.com</a>><br>
              # Date 1435592559 -7200<br>
              #      Mon Jun 29 17:42:39 2015 +0200<br>
              # Node ID f1d674589538cbf1c6d066b203016009d7c679b2<br>
              # Parent  2d3ead418f13410650da664144462a54a0312163<br>
              autocomplete: fix completion of repository owner<br>
              <br>
              The owner field of a repository setting was supposed to be
              autocompletable,<br>
              but never really did (at least not in Kallithea, probably
              it once did in<br>
              Rhodecode).<br>
              <br>
              Instead of making yet another 'OwnerAutoComplete', make a
              generic<br>
              SimpleUserAutoComplete that can be reused in other places
              that only need<br>
              completion of a text input field.<br>
              <br>
              diff --git a/kallithea/controllers/admin/repos.py
              b/kallithea/controllers/admin/repos.py<br>
              --- a/kallithea/controllers/admin/repos.py<br>
              +++ b/kallithea/controllers/admin/repos.py<br>
              @@ -370,6 +370,8 @@ class
              ReposController(BaseRepoController<br>
              <br>
                       c.repo_fields = RepositoryField.query()\<br>
                           .filter(RepositoryField.repository ==
              c.repo_info).all()<br>
              +        repo_model = RepoModel()<br>
              +        c.users_array = repo_model.get_users_js()<br>
                       c.active = 'settings'<br>
                       return htmlfill.render(<br>
                           render('admin/repos/repo_edit.html'),<br>
            </blockquote>
            <div><br>
            </div>
            <div>This fails for all the other places where
              repo_edit.html is used.<br>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
    More specifically:<br>
    c.users_array is also needed for form validation errors on failing
    updates.<br>
    <br>
    I don't know if it is needed in more places ... apparently not.<br>
    <br>
    It would be nice if this users list always was available for
    computation on demand from the templates. Or ultimately, for scaling
    to a huge site where it not is feasible to fetch all users, we would
    have to send queries to the server and just get the few results
    back. The same applies to many other lists or template data.<br>
    <br>
    /Mads<br>
  </body>
</html>