Changeset - e272be3244f0
[Not reviewed]
beta
0 1 0
Marcin Kuzminski - 15 years ago 2011-05-12 00:37:40
marcin@python-works.com
fixed regresion made in previos commit, that introduced bug in handling regular repositories
1 file changed with 13 insertions and 5 deletions:
0 comments (0 inline, 0 general)
rhodecode/model/forms.py
Show inline comments
 
@@ -217,14 +217,21 @@ def ValidRepoName(edit, old_data):
 
                e_dict = {'repo_name': _('This repository name is disallowed')}
 
                raise formencode.Invalid('', value, state, error_dict=e_dict)
 

	
 
            gr = Group.get(value.get('repo_group'))
 

	
 
            # value needs to be aware of group name
 
            repo_name_full = gr.full_path + '/' + repo_name
 
            if value.get('repo_group'):
 
                gr = Group.get(value.get('repo_group'))
 
                group_path = gr.full_path
 
                # value needs to be aware of group name
 
                repo_name_full = group_path + '/' + repo_name
 
            else:
 
                group_path = ''
 
                repo_name_full = repo_name
 

	
 

	
 
            value['repo_name_full'] = repo_name_full
 
            if old_data.get('repo_name') != repo_name_full or not edit:
 

	
 
                if gr.full_path != '':
 
                if group_path != '':
 
                    if RepoModel().get_by_repo_name(repo_name_full,):
 
                        e_dict = {'repo_name':_('This repository already '
 
                                                'exists in group "%s"') %
 
@@ -234,7 +241,8 @@ def ValidRepoName(edit, old_data):
 

	
 
                else:
 
                    if RepoModel().get_by_repo_name(repo_name_full):
 
                        e_dict = {'repo_name':_('This repository already exists')}
 
                        e_dict = {'repo_name':_('This repository '
 
                                                'already exists')}
 
                        raise formencode.Invalid('', value, state,
 
                                                 error_dict=e_dict)
 
            return value
0 comments (0 inline, 0 general)