Mercurial > kallithea
changeset 3110:144128efc6ab beta
- #683 fixed difference between messages about not mapped repositories
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Fri, 14 Dec 2012 04:19:12 +0100 |
parents | 6178a0e7cbaf |
children | 2dd0e1d92386 |
files | docs/changelog.rst rhodecode/controllers/admin/repos.py rhodecode/controllers/forks.py rhodecode/controllers/settings.py rhodecode/lib/helpers.py |
diffstat | 5 files changed, 14 insertions(+), 36 deletions(-) [+] |
line wrap: on
line diff
--- a/docs/changelog.rst Fri Dec 14 04:03:46 2012 +0100 +++ b/docs/changelog.rst Fri Dec 14 04:19:12 2012 +0100 @@ -32,6 +32,7 @@ - default permissions can get duplicated after migration - fixed changeset status labels, they now select radio buttons - #682 translation difficult for multi-line text +- #683 fixed difference between messages about not mapped repositories 1.5.0 (**2012-12-12**) ----------------------
--- a/rhodecode/controllers/admin/repos.py Fri Dec 14 04:03:46 2012 +0100 +++ b/rhodecode/controllers/admin/repos.py Fri Dec 14 04:19:12 2012 +0100 @@ -89,12 +89,7 @@ repo = db_repo.scm_instance if c.repo_info is None: - h.flash(_('%s repository is not mapped to db perhaps' - ' it was created or renamed from the filesystem' - ' please run the application again' - ' in order to rescan repositories') % repo_name, - category='error') - + h.not_mapped_error(repo_name) return redirect(url('repos')) ##override defaults for exact repo info here git/hg etc @@ -310,12 +305,7 @@ repo_model = RepoModel() repo = repo_model.get_by_repo_name(repo_name) if not repo: - h.flash(_('%s repository is not mapped to db perhaps' - ' it was moved or renamed from the filesystem' - ' please run the application again' - ' in order to rescan repositories') % repo_name, - category='error') - + h.not_mapped_error(repo_name) return redirect(url('repos')) try: action_logger(self.rhodecode_user, 'admin_deleted_repo',
--- a/rhodecode/controllers/forks.py Fri Dec 14 04:03:46 2012 +0100 +++ b/rhodecode/controllers/forks.py Fri Dec 14 04:19:12 2012 +0100 @@ -71,12 +71,7 @@ repo = db_repo.scm_instance if c.repo_info is None: - h.flash(_('%s repository is not mapped to db perhaps' - ' it was created or renamed from the filesystem' - ' please run the application again' - ' in order to rescan repositories') % repo_name, - category='error') - + h.not_mapped_error(repo_name) return redirect(url('repos')) c.default_user_id = User.get_by_username('default').user_id @@ -131,12 +126,7 @@ def fork(self, repo_name): c.repo_info = Repository.get_by_repo_name(repo_name) if not c.repo_info: - h.flash(_('%s repository is not mapped to db perhaps' - ' it was created or renamed from the file system' - ' please run the application again' - ' in order to rescan repositories') % repo_name, - category='error') - + h.not_mapped_error(repo_name) return redirect(url('home')) defaults = self.__load_data(repo_name)
--- a/rhodecode/controllers/settings.py Fri Dec 14 04:03:46 2012 +0100 +++ b/rhodecode/controllers/settings.py Fri Dec 14 04:19:12 2012 +0100 @@ -77,12 +77,7 @@ repo = db_repo.scm_instance if c.repo_info is None: - h.flash(_('%s repository is not mapped to db perhaps' - ' it was created or renamed from the filesystem' - ' please run the application again' - ' in order to rescan repositories') % repo_name, - category='error') - + h.not_mapped_error(repo_name) return redirect(url('home')) ##override defaults for exact repo info here git/hg etc @@ -157,12 +152,7 @@ repo_model = RepoModel() repo = repo_model.get_by_repo_name(repo_name) if not repo: - h.flash(_('%s repository is not mapped to db perhaps' - ' it was moved or renamed from the filesystem' - ' please run the application again' - ' in order to rescan repositories') % repo_name, - category='error') - + h.not_mapped_error(repo_name) return redirect(url('home')) try: action_logger(self.rhodecode_user, 'user_deleted_repo',
--- a/rhodecode/lib/helpers.py Fri Dec 14 04:03:46 2012 +0100 +++ b/rhodecode/lib/helpers.py Fri Dec 14 04:19:12 2012 +0100 @@ -1157,3 +1157,10 @@ "repository:vcs OR repository:test" "username:test AND repository:test*" ''')) + + +def not_mapped_error(repo_name): + flash(_('%s repository is not mapped to db perhaps' + ' it was created or renamed from the filesystem' + ' please run the application again' + ' in order to rescan repositories') % repo_name, category='error')