# HG changeset patch # User Marcin Kuzminski # Date 1305153460 -7200 # Node ID e272be3244f0e006a2a4236ad0b3b9d262c52e96 # Parent a7a772ea7b9599760dc95a08eee98844c9a18178 fixed regresion made in previos commit, that introduced bug in handling regular repositories diff -r a7a772ea7b95 -r e272be3244f0 rhodecode/model/forms.py --- a/rhodecode/model/forms.py Thu May 12 00:31:17 2011 +0200 +++ b/rhodecode/model/forms.py Thu May 12 00:37:40 2011 +0200 @@ -217,14 +217,21 @@ 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 @@ 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