comparison rhodecode/model/repo.py @ 1517:142a05597cba beta

assure that we don't have an empty description when creating a repo
author Marcin Kuzminski <marcin@python-works.com>
date Fri, 07 Oct 2011 16:33:01 +0200
parents 7d687ed11929
children 5585609772d0 04027bdb876c
comparison
equal deleted inserted replaced
1516:582686d76cb6 1517:142a05597cba
190 else: 190 else:
191 v = repo_name_full 191 v = repo_name_full
192 if k == 'repo_group': 192 if k == 'repo_group':
193 k = 'group_id' 193 k = 'group_id'
194 194
195 if k == 'description':
196 v = v or repo_name
197
195 setattr(new_repo, k, v) 198 setattr(new_repo, k, v)
196 199
197 if fork: 200 if fork:
198 parent_repo = self.sa.query(Repository)\ 201 parent_repo = self.sa.query(Repository)\
199 .filter(Repository.repo_name == org_full_name).one() 202 .filter(Repository.repo_name == org_full_name).one()
300 :param alias: 303 :param alias:
301 :param parent_id: 304 :param parent_id:
302 :param clone_uri: 305 :param clone_uri:
303 """ 306 """
304 from rhodecode.lib.utils import is_valid_repo 307 from rhodecode.lib.utils import is_valid_repo
305 308
306 if new_parent_id: 309 if new_parent_id:
307 paths = Group.get(new_parent_id).full_path.split(Group.url_sep()) 310 paths = Group.get(new_parent_id).full_path.split(Group.url_sep())
308 new_parent_path = os.sep.join(paths) 311 new_parent_path = os.sep.join(paths)
309 else: 312 else:
310 new_parent_path = '' 313 new_parent_path = ''