Mercurial > kallithea
diff rhodecode/model/repo.py @ 1028:f42ee60e673b beta
fixed issue with db transaction when filesystem creation of repository failed
added extra logging
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Fri, 11 Feb 2011 11:30:04 +0100 |
parents | 26114d182efe |
children | 405b80e4ccd5 |
line wrap: on
line diff
--- a/rhodecode/model/repo.py Fri Feb 11 10:39:40 2011 +0100 +++ b/rhodecode/model/repo.py Fri Feb 11 11:30:04 2011 +0100 @@ -211,21 +211,22 @@ .filter(Permission.permission_name == default_perm)\ .one().permission_id - repo_to_perm.repository_id = new_repo.repo_id + repo_to_perm.repository = new_repo repo_to_perm.user_id = UserModel(self.sa)\ .get_by_username('default', cache=False).user_id self.sa.add(repo_to_perm) + + if not just_db: + self.__create_repo(repo_name, form_data['repo_type']) + self.sa.commit() - #now automatically start following this repository as owner from rhodecode.model.scm import ScmModel ScmModel(self.sa).toggle_following_repo(new_repo.repo_id, cur_user.user_id) - if not just_db: - self.__create_repo(repo_name, form_data['repo_type']) except: log.error(traceback.format_exc()) self.sa.rollback()