##// END OF EJS Templates
fixed regresion made in previos commit, that introduced bug in handling regular repositories
marcink -
r1324:e272be32 beta
parent child Browse files
Show More
@@ -217,14 +217,21 def ValidRepoName(edit, old_data):
217 217 e_dict = {'repo_name': _('This repository name is disallowed')}
218 218 raise formencode.Invalid('', value, state, error_dict=e_dict)
219 219
220 gr = Group.get(value.get('repo_group'))
221 220
222 # value needs to be aware of group name
223 repo_name_full = gr.full_path + '/' + repo_name
221 if value.get('repo_group'):
222 gr = Group.get(value.get('repo_group'))
223 group_path = gr.full_path
224 # value needs to be aware of group name
225 repo_name_full = group_path + '/' + repo_name
226 else:
227 group_path = ''
228 repo_name_full = repo_name
229
230
224 231 value['repo_name_full'] = repo_name_full
225 232 if old_data.get('repo_name') != repo_name_full or not edit:
226 233
227 if gr.full_path != '':
234 if group_path != '':
228 235 if RepoModel().get_by_repo_name(repo_name_full,):
229 236 e_dict = {'repo_name':_('This repository already '
230 237 'exists in group "%s"') %
@@ -234,7 +241,8 def ValidRepoName(edit, old_data):
234 241
235 242 else:
236 243 if RepoModel().get_by_repo_name(repo_name_full):
237 e_dict = {'repo_name':_('This repository already exists')}
244 e_dict = {'repo_name':_('This repository '
245 'already exists')}
238 246 raise formencode.Invalid('', value, state,
239 247 error_dict=e_dict)
240 248 return value
General Comments 0
You need to be logged in to leave comments. Login now