# HG changeset patch # User Marcin Kuzminski # Date 2011-05-11 22:37:40 # Node ID e272be3244f0e006a2a4236ad0b3b9d262c52e96 # Parent a7a772ea7b9599760dc95a08eee98844c9a18178 fixed regresion made in previos commit, that introduced bug in handling regular repositories diff --git a/rhodecode/model/forms.py b/rhodecode/model/forms.py --- a/rhodecode/model/forms.py +++ b/rhodecode/model/forms.py @@ -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