Changeset - 03d51a2a395d
[Not reviewed]
stable
0 1 0
Mads Kiilerich (mads) - 3 years ago 2022-12-10 18:06:17
mads@kiilerich.com
repo group: always update fullpath group_name when changing parent

It was usually set anyway before, as the group name usually was specified
without being changed and triggered this update.
1 file changed with 1 insertions and 0 deletions:
0 comments (0 inline, 0 general)
kallithea/model/repo_group.py
Show inline comments
 
@@ -277,24 +277,25 @@ class RepoGroupModel(object):
 

	
 
    def update(self, repo_group, repo_group_args):
 
        try:
 
            repo_group = db.RepoGroup.guess_instance(repo_group)
 
            old_path = repo_group.full_path
 

	
 
            # change properties
 
            if 'group_description' in repo_group_args:
 
                repo_group.group_description = repo_group_args['group_description']
 
            if 'parent_group_id' in repo_group_args:
 
                assert repo_group_args['parent_group_id'] != '-1', repo_group_args  # RepoGroupForm should have converted to None
 
                repo_group.parent_group = db.RepoGroup.get(repo_group_args['parent_group_id'])
 
                repo_group.group_name = repo_group.get_new_name(repo_group.name)
 
            if 'group_name' in repo_group_args:
 
                group_name = repo_group_args['group_name']
 
                if kallithea.lib.utils2.repo_name_slug(group_name) != group_name:
 
                    raise Exception('invalid repo group name %s' % group_name)
 
                repo_group.group_name = repo_group.get_new_name(group_name)
 
            new_path = repo_group.full_path
 
            meta.Session().add(repo_group)
 

	
 
            # iterate over all members of this groups and do fixes
 
            # if obj is a repoGroup also fix the name of the group according
 
            # to the parent
 
            # if obj is a Repo fix it's name
0 comments (0 inline, 0 general)