[PATCH 13 of 19] autocomplete: fix completion of repository owner

Mads Kiilerich mads at kiilerich.com
Mon Jul 20 13:17:49 UTC 2015


On 07/20/2015 02:00 PM, Thomas De Schampheleire wrote:
> On Thu, Jul 16, 2015 at 8:35 PM, Mads Kiilerich <mads at kiilerich.com> wrote:
>> On 07/16/2015 06:43 PM, Mads Kiilerich wrote:
>>
>> On Tue, Jun 30, 2015 at 10:43 PM, Thomas De Schampheleire
>> <patrickdepinguin at gmail.com> wrote:
>>> # HG changeset patch
>>> # User Thomas De Schampheleire <thomas.de.schampheleire at gmail.com>
>>> # Date 1435592559 -7200
>>> #      Mon Jun 29 17:42:39 2015 +0200
>>> # Node ID f1d674589538cbf1c6d066b203016009d7c679b2
>>> # Parent  2d3ead418f13410650da664144462a54a0312163
>>> autocomplete: fix completion of repository owner
>>>
>>> The owner field of a repository setting was supposed to be
>>> autocompletable,
>>> but never really did (at least not in Kallithea, probably it once did in
>>> Rhodecode).
>>>
>>> Instead of making yet another 'OwnerAutoComplete', make a generic
>>> SimpleUserAutoComplete that can be reused in other places that only need
>>> completion of a text input field.
>>>
>>> diff --git a/kallithea/controllers/admin/repos.py
>>> b/kallithea/controllers/admin/repos.py
>>> --- a/kallithea/controllers/admin/repos.py
>>> +++ b/kallithea/controllers/admin/repos.py
>>> @@ -370,6 +370,8 @@ class ReposController(BaseRepoController
>>>
>>>           c.repo_fields = RepositoryField.query()\
>>>               .filter(RepositoryField.repository == c.repo_info).all()
>>> +        repo_model = RepoModel()
>>> +        c.users_array = repo_model.get_users_js()
>>>           c.active = 'settings'
>>>           return htmlfill.render(
>>>               render('admin/repos/repo_edit.html'),
>>
>> This fails for all the other places where repo_edit.html is used.
>>
>>
>> More specifically:
>> c.users_array is also needed for form validation errors on failing updates.
>>
>> I don't know if it is needed in more places ... apparently not.
> I looked at the code, and again at your comment, but I don't
> understand what you're saying. Can you clarify? Which URL / action is
> not working?
>
> c.users_array is used client-side to provide autocompletion hints, how
> is this related to form validation? And what kind of 'failing updates'
> do you mean precisely?

The repo edit form would fail when trying to show form validation errors 
after providing invalid values (for example invalid clone url).

I fixed the issue I saw with 
https://kallithea-scm.org/repos/kallithea/changeset/14e2291a8f0b25153474312f2f6c43776fc37d04 
. That is probably enough.

/Mads


More information about the kallithea-general mailing list