# HG changeset patch # User toras9000 # Date 1670692092 -3600 # Node ID fdc9c2fd439ae7c73c7f4021aa9084273499675d # Parent 03d51a2a395dd40c1f29c4e7be5fb4dfcd81b75f 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. diff -r 03d51a2a395d -r fdc9c2fd439a CONTRIBUTORS --- a/CONTRIBUTORS Sat Dec 10 18:06:17 2022 +0100 +++ b/CONTRIBUTORS Sat Dec 10 18:08:12 2022 +0100 @@ -2,6 +2,7 @@ Mads Kiilerich 2016-2022 Manuel Jacob 2019-2020 2022 + toras9000 2022 Thomas De Schampheleire 2014-2021 ssantos 2018-2021 Private 2019-2021 diff -r 03d51a2a395d -r fdc9c2fd439a kallithea/controllers/api/api.py --- a/kallithea/controllers/api/api.py Sat Dec 10 18:06:17 2022 +0100 +++ b/kallithea/controllers/api/api.py Sat Dec 10 18:08:12 2022 +0100 @@ -1791,13 +1791,14 @@ 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( diff -r 03d51a2a395d -r fdc9c2fd439a kallithea/templates/about.html --- a/kallithea/templates/about.html Sat Dec 10 18:06:17 2022 +0100 +++ b/kallithea/templates/about.html Sat Dec 10 18:08:12 2022 +0100 @@ -26,6 +26,7 @@
  • Copyright © 2012–2022, Mads Kiilerich
  • Copyright © 2019–2020, 2022, Manuel Jacob
  • +
  • Copyright © 2022, toras9000
  • Copyright © 2014–2021, Thomas De Schampheleire
  • Copyright © 2015–2017, 2019–2021, Étienne Gilli
  • Copyright © 2018–2021, ssantos
  • diff -r 03d51a2a395d -r fdc9c2fd439a kallithea/tests/api/api_base.py --- a/kallithea/tests/api/api_base.py Sat Dec 10 18:06:17 2022 +0100 +++ b/kallithea/tests/api/api_base.py Sat Dec 10 18:08:12 2022 +0100 @@ -1854,7 +1854,7 @@ #('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'