Show More
@@ -217,14 +217,21 def ValidRepoName(edit, old_data): | |||||
217 | e_dict = {'repo_name': _('This repository name is disallowed')} |
|
217 | e_dict = {'repo_name': _('This repository name is disallowed')} | |
218 | raise formencode.Invalid('', value, state, error_dict=e_dict) |
|
218 | raise formencode.Invalid('', value, state, error_dict=e_dict) | |
219 |
|
219 | |||
220 | gr = Group.get(value.get('repo_group')) |
|
|||
221 |
|
220 | |||
222 |
|
|
221 | if value.get('repo_group'): | |
223 | repo_name_full = gr.full_path + '/' + repo_name |
|
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 | value['repo_name_full'] = repo_name_full |
|
231 | value['repo_name_full'] = repo_name_full | |
225 | if old_data.get('repo_name') != repo_name_full or not edit: |
|
232 | if old_data.get('repo_name') != repo_name_full or not edit: | |
226 |
|
233 | |||
227 |
if gr |
|
234 | if group_path != '': | |
228 | if RepoModel().get_by_repo_name(repo_name_full,): |
|
235 | if RepoModel().get_by_repo_name(repo_name_full,): | |
229 | e_dict = {'repo_name':_('This repository already ' |
|
236 | e_dict = {'repo_name':_('This repository already ' | |
230 | 'exists in group "%s"') % |
|
237 | 'exists in group "%s"') % | |
@@ -234,7 +241,8 def ValidRepoName(edit, old_data): | |||||
234 |
|
241 | |||
235 | else: |
|
242 | else: | |
236 | if RepoModel().get_by_repo_name(repo_name_full): |
|
243 | if RepoModel().get_by_repo_name(repo_name_full): | |
237 |
e_dict = {'repo_name':_('This repository |
|
244 | e_dict = {'repo_name':_('This repository ' | |
|
245 | 'already exists')} | |||
238 | raise formencode.Invalid('', value, state, |
|
246 | raise formencode.Invalid('', value, state, | |
239 | error_dict=e_dict) |
|
247 | error_dict=e_dict) | |
240 | return value |
|
248 | return value |
General Comments 0
You need to be logged in to leave comments.
Login now