Changeset - fdc9c2fd439a
[Not reviewed]
stable
0 4 0
toras9000 - 3 years ago 2022-12-10 18:08:12
toras9000@gmail.com
Grafted from: 6d5005f6e521
repo group: fix API for updating parent

With other bugs out of the way, the API implementation just has to pass the new
group id correctly.

Note that - as in many other places - moving things to the top level doesn't
work.

Original patch has been modified by Mads Kiilerich.
4 files changed with 5 insertions and 2 deletions:
0 comments (0 inline, 0 general)
CONTRIBUTORS
Show inline comments
 
List of contributors to Kallithea project:
 

	
 
    Mads Kiilerich <mads@kiilerich.com> 2016-2022
 
    Manuel Jacob <me@manueljacob.de> 2019-2020 2022
 
    toras9000 <toras9000@gmail.com> 2022
 
    Thomas De Schampheleire <thomas.de_schampheleire@nokia.com> 2014-2021
 
    ssantos <ssantos@web.de> 2018-2021
 
    Private <adamantine.sword@gmail.com> 2019-2021
 
    Étienne Gilli <etienne@gilli.io> 2020-2021
 
    fresh <fresh190@protonmail.com> 2020-2021
 
    robertus <robertuss12@gmail.com> 2020-2021
kallithea/controllers/api/api.py
Show inline comments
 
@@ -1788,19 +1788,20 @@ class ApiController(JSONRPCController):
 
    @HasPermissionAnyDecorator('hg.admin')
 
    def update_repo_group(self, repogroupid, group_name=None,
 
                          description=None,
 
                          owner=None,
 
                          parent=None):
 
        repo_group = get_repo_group_or_error(repogroupid)
 
        parent_repo_group_id = None if parent is None else get_repo_group_or_error(parent).group_id
 

	
 
        updates = {}
 
        try:
 
            store_update(updates, group_name, 'group_name')
 
            store_update(updates, description, 'group_description')
 
            store_update(updates, owner, 'owner')
 
            store_update(updates, parent, 'parent_group')
 
            store_update(updates, parent_repo_group_id, 'parent_group_id')
 
            repo_group = RepoGroupModel().update(repo_group, updates)
 
            meta.Session().commit()
 
            return dict(
 
                msg='updated repository group ID:%s %s' % (repo_group.group_id,
 
                                                           repo_group.group_name),
 
                repo_group=repo_group.get_api_data()
kallithea/templates/about.html
Show inline comments
 
@@ -23,12 +23,13 @@
 
  <p>Kallithea is copyrighted by various authors, including but not
 
  necessarily limited to the following:</p>
 
  <ul>
 

	
 
  <li>Copyright &copy; 2012&ndash;2022, Mads Kiilerich</li>
 
  <li>Copyright &copy; 2019&ndash;2020, 2022, Manuel Jacob</li>
 
  <li>Copyright &copy; 2022, toras9000</li>
 
  <li>Copyright &copy; 2014&ndash;2021, Thomas De Schampheleire</li>
 
  <li>Copyright &copy; 2015&ndash;2017, 2019&ndash;2021, Étienne Gilli</li>
 
  <li>Copyright &copy; 2018&ndash;2021, ssantos</li>
 
  <li>Copyright &copy; 2019&ndash;2021, Private</li>
 
  <li>Copyright &copy; 2020&ndash;2021, fresh</li>
 
  <li>Copyright &copy; 2020&ndash;2021, robertus</li>
kallithea/tests/api/api_base.py
Show inline comments
 
@@ -1851,13 +1851,13 @@ class _BaseTestApi(object):
 
        self._compare_error(id_, expected, given=response.body)
 

	
 
    @base.parametrize('changing_attr,updates', [
 
        #('owner', {'owner': base.TEST_USER_REGULAR_LOGIN}),  # currently broken
 
        ('description', {'description': 'new description'}),
 
        ('group_name', {'group_name': 'new_repo_name'}),
 
        #('parent', {'parent': 'test_group_for_update'}),  # currently broken
 
        ('parent', {'parent': 'test_group_for_update'}),
 
    ])
 
    def test_api_update_repo_group(self, changing_attr, updates):
 
        group_name = 'lololo'
 
        repo_group = fixture.create_repo_group(group_name)
 

	
 
        new_group_name = group_name
0 comments (0 inline, 0 general)